Android widget stops reacting on events

Search This thread

whyte624

Member
Aug 25, 2014
19
2
My widget stops reacting on touch events. After installation it works fine, but after some time (couple of hours or a day) it does not react on touches. And starts to work normally after reboot or reinstallation. What could be the problem?

Repository on github with the code: whyte624/displayoffwidget
 

kalpetros

Senior Member
Jul 21, 2013
175
30
35.34, 25.13
My widget stops reacting on touch events. After installation it works fine, but after some time (couple of hours or a day) it does not react on touches. And starts to work normally after reboot or reinstallation. What could be the problem?

Repository on github with the code: whyte624/displayoffwidget

Maybe the click event is lost when the system kills the widget's process.

Check your onUpdate method.
 
Last edited:

whyte624

Member
Aug 25, 2014
19
2
Another problem is that widget is not visible in widgets' list on some devices, even though it is installed in device's memory.
 

kalpetros

Senior Member
Jul 21, 2013
175
30
35.34, 25.13
How can I do it?
If I add Toast, would it be enough?

Make sure you send all the data needed to fully reconstruct the widget every time you update it with a RemoteViews object.

Another problem is that widget is not visible in widgets' list on some devices, even though it is installed in device's memory.

Where did you put the receiver tag?

You need to put it inside the application tag.

For example:

Code:
<manifest>
  <application>
    <receiver>
      ...
    </receiver>
  </application>
</manifest>

Then you need an activity that will appear on the launcher.

Also read this.
 
  • Like
Reactions: whyte624

whyte624

Member
Aug 25, 2014
19
2
Thank you for the response!

Where did you put the receiver tag?
You need to put it inside the application tag.

Receiver tag is inside application tag. And RemoteViews works in the same way as it works in the post that you've pointed out.

I beleive, that process was killed by system, due to low memory. Is there a way to change widget's view, when process is killed?

And widget is not visible in list on tablets.
 

kalpetros

Senior Member
Jul 21, 2013
175
30
35.34, 25.13
Thank you for the response!



Receiver tag is inside application tag. And RemoteViews works in the same way as it works in the post that you've pointed out.

I beleive, that process was killed by system, due to low memory. Is there a way to change widget's view, when process is killed?

And widget is not visible in list on tablets.

Can you manually kill the service from DDMS and paste the output from logcat here?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    How can I do it?
    If I add Toast, would it be enough?

    Make sure you send all the data needed to fully reconstruct the widget every time you update it with a RemoteViews object.

    Another problem is that widget is not visible in widgets' list on some devices, even though it is installed in device's memory.

    Where did you put the receiver tag?

    You need to put it inside the application tag.

    For example:

    Code:
    <manifest>
      <application>
        <receiver>
          ...
        </receiver>
      </application>
    </manifest>

    Then you need an activity that will appear on the launcher.

    Also read this.