android - Some appwidgets won't update? -


i writing launcher activity host appwidgets. here doing.

  1. my container view appwidgets customized viewgroup.
  2. when adding widgets, call config activity first widget being added.
  3. i calling appwidgethost.startlistening() in main activity.onstart() , stoplistening() in onstop()
  4. when adding widget, here application.getappwidgetmanager().bindappwidgetidifallowed(appwidgetid, componentname); appwidgethostview hostview = application.getappwidgethost().createview(context, appwidgetid, appwidgetinfo); hostview.setappwidget(widgetid, appwidgetinfo); myviewgroup.addview(hostview);
  5. i not seeing remoteexception in logs , calling appwidgethost.startlistening() aggressively doesn't help.

in addition, not widgets fail update, stock clock widget, example, works fine. happens on minimalistic text widget , others. once widget has been added, able update 1~2 minutes before stop working. other related observation when tap minimalistic widget, modify layout , save. new layout won't applied existing widget. makes me feel there buggy in code, cannot figure out where.

thanks in advance!

sorry cannot paste detail code here because scattered around. can provide detail information if need. again!

never mind. figured out eventually. reason using application context instead of activity context when creating appwidgetmanager , appwidgethost.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -