freehandvn / gtalksms

Automatically exported from code.google.com/p/gtalksms
0 stars 0 forks source link

widget sometimes stops reponding to presses. #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After moving around various apps, an existing Widget may stop responding to 
presses and to status updates.  Another symptom of it is that the widget text 
is blank instead of "Free" - you can tell if the widget still works by seeing 
if it has any text.  I can repro it on a 2.2 emulator by:

* Add the widget to home and use it.  Note it has text and works.
* Start Messaging app.
* Press Home.
* Widget now has no text and pressing it has no effect.

This is a different problem to the recently introduced problem when the widget 
failed to see the 'disconnected' state - I noticed it the first time I tried 
the widget, but only dug into it today.

At this stage I've no idea why...

Original issue reported on code.google.com by skippy.hammond@gmail.com on 31 Dec 2010 at 5:48

GoogleCodeExporter commented 9 years ago
Key thing for above repro: On the device, start the "Dev Tools" app, then 
select "Development Settings", then check "Immediately Destroy Activities".  
I'm still not sure how it is related, but the widget should still work in that 
case (as Android will still shut down the activities eventually, just later)

Original comment by skippy.hammond@gmail.com on 31 Dec 2010 at 6:07

GoogleCodeExporter commented 9 years ago
The problem seems to be related to the main service updating the views in 
response to state notifications - removing the manager.updateAppWidget() call 
from the service made things work as expected (although obviously didn't allow 
the widget to have the correct drawable).

I fixed this by merging the widget's receiver into the widget itself, primarily 
to get a good 'context' to work with.  The widget itself handles our brandcast 
and updates itself - MainService knows nothing about app widgets.  Finally, I 
added a way for the widget to request the service broadcast its *current* 
state, so that when a new widget is added it automatically gets the correct 
initial state drawn.

Original comment by skippy.hammond@gmail.com on 1 Jan 2011 at 3:45

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Florent....@gmail.com on 1 Jan 2011 at 9:57

GoogleCodeExporter commented 9 years ago

Original comment by fschm...@gmail.com on 25 Aug 2011 at 7:51