FORUMS

XeroAsh Theme for CM12

This theme by XDA Senior Member balrajs99 features a black and slate gray UI that gives your phone a … more

Samsung Galaxy S6 To Receive Major Camera Update

When the Samsung Galaxy S6 and S6 Edge were launched, they became the prime focus for … more

Tactile: An Addicting Game with Beautiful Material Design

The game industry has been around for decades, catering to a wide … more

Android’s Consistency and The User Experience

This is a site of power users, and it is fair to say that most of us are more … more
Post Reply Subscribe to Thread Email Thread

Android widget stops reacting on events

25th August 2014, 03:38 PM |#1  
OP Junior Member
Thanks Meter: 2
 
More
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, 05:28 PM |#2  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
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 05:32 PM.
26th August 2014, 07:45 AM |#3  
OP Junior Member
Thanks Meter: 2
 
More
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, 06:43 AM |#4  
OP Junior Member
Thanks Meter: 2
 
More
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, 03:26 PM |#5  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
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, 04:57 PM |#6  
OP Junior Member
Thanks Meter: 2
 
More
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, 08:35 PM |#7  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
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, 06:57 AM |#8  
OP Junior Member
Thanks Meter: 2
 
More
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, 11:24 AM |#9  
kalpetros's Avatar
Senior Member
Flag 35.34, 25.13
Thanks Meter: 29
 
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