Battery Charged in 30 Seconds? Maybe in 2016

Phones and tablets are getting more and more power hungry with each passing generation. Their … more

ZArchive Manages Your File Archives

Today smartphones are quite powerful devices that can handle multiple processes at once. In fact, some of … more

Regain Double Tap to Wake Functionality on the Nexus 6

A few months ago, Google announced its newest flagship device, the Nexus 6, alongside … more

Clean Your Recent Apps – XDA Xposed Tuesday

In this day and age, you have quite a few apps installed and running on your Android … 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