Refreshing Activity

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Refreshing Activity

Postby speedy » Mon Oct 26, 2009 10:39 am

Hello,

I need to refresh an activity each minute.

I found some code for refreshing and it is working good.

[code] mHandler.removeCallbacks(mUpdateTimeTask);
mHandler.postDelayed(mUpdateTimeTask, 10000);

private Runnable mUpdateTimeTask = new Runnable() {
public void run() {
Calendar now = Calendar.getInstance();
now.add(Calendar.MILLISECOND, 10000);
if (_lastFetchTime.compareTo(now) < 0 ){
}
_lastFetchTime.add(Calendar.MILLISECOND, 10000);
mHandler.postAtTime(this, _lastFetchTime.getTimeInMillis());
}
}[/code]

I need to refresh my all views (textviews, scroolviews..), after 10 seconds passed.

I tried to destroy all views under a container view by removeAllViews(); and removeAllViewsInLayout(); but no luck.

Any help would be appreciated..

thanks
speedy
Freshman
Freshman
 
Posts: 2
Joined: Mon Oct 26, 2009 10:29 am

Top

Postby speedy » Tue Oct 27, 2009 11:53 am

Solved!

removeAllViews(); works fine. It seems there is another coding error.

So the refreshing code and deleting views code work..
speedy
Freshman
Freshman
 
Posts: 2
Joined: Mon Oct 26, 2009 10:29 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests