Note that there are some explanatory texts on larger screens.

plurals
  1. POUI update on widget stops after a few hours with no error or exception
    primarykey
    data
    text
    <p>I created a widget that uses a service with wakelock to update and parse data from an xml and update the widget's UI so that items would "rotate every few seconds (standard news feed widget).</p> <p>The problem is that the UI stops updating after a few hours although the data keeps updating.</p> <p>Here's the code I am using to update the UI: </p> <pre><code>mUpdateTimeTask = null; mUpdateTimeTask = new Runnable() { public void run() { if(which_item+1 &lt; Widget_titles.length) which_item++; else which_item = 0; if(Widget_which_item_ed != null) { Widget_which_item_ed.putInt("WIDGET_WHICH_ITEM", which_item); Widget_which_item_ed.commit(); } else { Widget_which_item = context.getSharedPreferences("WIDGET_WHICH_ITEM", Context.MODE_WORLD_WRITEABLE); Widget_which_item_ed = Widget_which_item.edit(); Widget_which_item_ed.putInt("WIDGET_WHICH_ITEM", which_item); Widget_which_item_ed.commit(); } updateViews.setTextViewText(R.id.WidgetText, Widget_titles[which_item]); updateViews.setTextViewText(R.id.WidgetPostTime, rightNow.get(Calendar.MONTH)+"/"+rightNow.get(Calendar.DATE)+"/"+rightNow.get(Calendar.YEAR)); manager = AppWidgetManager.getInstance(context); manager.updateAppWidget(WidgetId, updateViews); mHandler.removeCallbacks(mUpdateTimeTask); mHandler.postDelayed(this, widget_interval * 1000); } }; mHandler.postDelayed(mUpdateTimeTask, widget_interval * 1000); Log.i(TAG, "sliding update handler was configed"); </code></pre> <p>I am really stuck and could really use help.</p> <p>Edit:</p> <p>i managed to go around this problem by implementing the BroadCastReciever for the screen on/off intents as shown in a tutorial here: <a href="http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/" rel="nofollow">http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/</a> and therefore the amount of time that the widget needs to run is much smaller.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload