Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,779,097 Members 44,511 Now Online
XDA Developers Android and Mobile Development Forum

home screen widget development problem

Tip us?
 
alinpha
Old
#1  
alinpha's Avatar
Junior Member - OP
Thanks Meter 2
Posts: 18
Join Date: Oct 2010
Default home screen widget development problem

hey there,

i was searching the web, but no success finding solution to my problem.
i am developing a simple home screen widget, and each time adding OR removing images from drawable folders, and relaunch the application onto emulator OR device, it messes up the images.

here is an example:

this is a screenshot of the widget before making changes at drawable folders:



and here is the screenshot of whats going on after changing drawable folders contents, and relaunching app from eclipse:



it takes random images that meant to appear at config activity, and i don't understand why.

i don't wanna post code, because there is a lot of it, and there are a bunch of classes, just wanted to ask if someone had similar problem, and if this is an eclipse bug, or it might be some problem with code.
 
SimplicityApks
Old
#2  
SimplicityApks's Avatar
Senior Member
Thanks Meter 324
Posts: 318
Join Date: May 2013
Location: Aachen
Quote:
Originally Posted by alinpha View Post
hey there,

i was searching the web, but no success finding solution to my problem.
i am developing a simple home screen widget, and each time adding OR removing images from drawable folders, and relaunch the application onto emulator OR device, it messes up the images.

here is an example:

this is a screenshot of the widget before making changes at drawable folders:



and here is the screenshot of whats going on after changing drawable folders contents, and relaunching app from eclipse:



it takes random images that meant to appear at config activity, and i don't understand why.

i don't wanna post code, because there is a lot of it, and there are a bunch of classes, just wanted to ask if someone had similar problem, and if this is an eclipse bug, or it might be some problem with code.
Did you clean the project first (in one of the menus there is the option clean...). That helped me when I was not seeing my resources being updated. And it might also be that you have to readd the widget to the home screen if you haven't tried already.
 
alinpha
Old
#3  
alinpha's Avatar
Junior Member - OP
Thanks Meter 2
Posts: 18
Join Date: Oct 2010
Quote:
Originally Posted by SimplicityApks View Post
Did you clean the project first (in one of the menus there is the option clean...). That helped me when I was not seeing my resources being updated. And it might also be that you have to readd the widget to the home screen if you haven't tried already.
Thanks for your reply.
Yea i did try cleaning project, but it didn't help.
I see all resources just fine, and there is no problem if i relaunch app with no changes at drawables.
The problem occurs only when i add, or delete images in the project.

And yes, if i re-add the widget to home screen the problem disappears,
but my big fear is that my users will have to re-add their widgets after i will publish an updated apk to google play.

I guess I'll have to publish a test apk, and see what happens on update.
 
SimplicityApks
Old
#4  
SimplicityApks's Avatar
Senior Member
Thanks Meter 324
Posts: 318
Join Date: May 2013
Location: Aachen
Quote:
Originally Posted by alinpha View Post
Thanks for your reply.
Yea i did try cleaning project, but it didn't help.
I see all resources just fine, and there is no problem if i relaunch app with no changes at drawables.
The problem occurs only when i add, or delete images in the project.

And yes, if i re-add the widget to home screen the problem disappears,
but my big fear is that my users will have to re-add their widgets after i will publish an updated apk to google play.

I guess I'll have to publish a test apk, and see what happens on update.
OK that's what I guessed as well... strange
I haven't done much with Homescreen widgets so far, but my guess would be to manually update the widget when your app is updated (via AppWidgetManager.notifyAppWidgetDataChanged()??!). Maybe this question can help.

The other option would be to debug which calls you get in the widgetProvider on updating the app. And make sure you didn't change any resource or Reveiver names!
The Following User Says Thank You to SimplicityApks For This Useful Post: [ Click to Expand ]
 
alinpha
Old
#5  
alinpha's Avatar
Junior Member - OP
Thanks Meter 2
Posts: 18
Join Date: Oct 2010
Quote:
Originally Posted by SimplicityApks View Post
OK that's what I guessed as well... strange
I haven't done much with Homescreen widgets so far, but my guess would be to manually update the widget when your app is updated (via AppWidgetManager.notifyAppWidgetDataChanged()??!). Maybe this question can help.

The other option would be to debug which calls you get in the widgetProvider on updating the app. And make sure you didn't change any resource or Reveiver names!
Well, I've uploaded the new version to google play, and after updating the app everything messed up.
I'll come back here after debugin.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes