How to Set a Video as Your Boot Animation

If you wish to make your phone truly unique, you may want to consider adding a nice boot animation. … more

TWRP for Nexus 6 and 9 Available, Unofficial CM12 Alpha for HTC Explorer! – XDA TV

Team Win Recovery Project for the Nexus 6 and Nexus … more

Jolla Tablet Announced: The Second Sailfish OS Device

A little over a year ago, Jolla released its first smartphone with the brand new Jolla … more

Android One Devices Get Unofficial CM12 Port

Android One was initially announced right before Android Lollipop. By releasing these cheap, yet … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Android widget stops reacting on events

OP whyte624

25th August 2014, 04:38 PM   |  #1  
OP Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Aug 2014
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
25th August 2014, 06:28 PM   |  #2  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
174 posts
Join Date:Joined: Jul 2013
More
Quote:
Originally Posted by whyte624

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 by kalpetros; 25th August 2014 at 06:32 PM.
26th August 2014, 08:45 AM   |  #3  
OP Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Aug 2014
Quote:
Originally Posted by kalpetros

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

Check your onUpdate method.

How can I do it?
If I add Toast, would it be enough?
27th August 2014, 07:43 AM   |  #4  
OP Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Aug 2014
Another problem is that widget is not visible in widgets' list on some devices, even though it is installed in device's memory.
27th August 2014, 04:26 PM   |  #5  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
174 posts
Join Date:Joined: Jul 2013
More
Quote:
Originally Posted by whyte624

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.

Quote:
Originally Posted by whyte624

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.
The Following User Says Thank You to kalpetros For This Useful Post: [ View ]
27th August 2014, 05:57 PM   |  #6  
OP Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Aug 2014
Thank you for the response!

Quote:
Originally Posted by kalpetros

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.
27th August 2014, 09:35 PM   |  #7  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
174 posts
Join Date:Joined: Jul 2013
More
Quote:
Originally Posted by whyte624

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?
28th August 2014, 07:57 AM   |  #8  
OP Junior Member
Thanks Meter: 2
 
19 posts
Join Date:Joined: Aug 2014
Quote:
Originally Posted by kalpetros

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

I'm not sure if I understand you correctly. I launched widget from IDE, then found it in application list (in IDE) and pressed 'stop' button. There were no output in logcat.
28th August 2014, 12:24 PM   |  #9  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
174 posts
Join Date:Joined: Jul 2013
More
Quote:
Originally Posted by whyte624

I'm not sure if I understand you correctly. I launched widget from IDE, then found it in application list (in IDE) and pressed 'stop' button. There were no output in logcat.

See this.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes