Well it worked if i just did it from the AppWidgetProvider.onUpdate.
And this service i wrote uses the same approach as Jeff Sharkey
(Android Team Developer)
uses in his example Widget:
http://code.google.com/p/android-sky/source/browse/trunk/Sky/src/org/jsharkey/sky/UpdateService.java
So what
B.t.w it worked fine on the Emulator intially (no widget where loaded
previously)
On Jul 14, 10:44 am, Kostya Vasilyev kmans...@gmail.com wrote:
Are you calling updateAppWidget from the worker thread?
If so, don't. UI calls can only be made from the UI thread.
Use a Handler / Runnable to
But what about the thread?
14.07.2010 14:09, TjerkW пишет:
B.t.w it worked fine on the Emulator intially (no widget where loaded
previously)
On Jul 14, 10:44 am, Kostya Vasilyevkmans...@gmail.com wrote:
Are you calling updateAppWidget from the worker thread?
If so, don't. UI calls can
Okay am i now using a IntentService without a thread
But now i get an ANR on a broadcast:
07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
receiver=android.os.binderpr...@43deed00
07-14 13:38:49.513:
On Wed, Jul 14, 2010 at 7:44 AM, TjerkW tje...@gmail.com wrote:
07-14 13:38:49.503: WARN/ActivityManager(59): Timeout of broadcast
BroadcastRecord{43f724c0 android.appwidget.action.APPWIDGET_ENABLED} -
receiver=android.os.binderpr...@43deed00
07-14 13:38:49.513: WARN/ActivityManager(59):
Request update is a very fast method
/**
* Request updates for the given widgets. Will only queue them up,
you are
* still responsible for starting a processing thread if needed,
usually by
* starting the parent service.
*/
public static void requestUpdate(int[]
Works on the emulator.. but on my nexus one i still get the nasty
nullpointerexception deep inside the Android apis
07-14 14:33:53.105: ERROR/HyvesWidgetService(13806): Failed updating
widget: 68, due to java.lang.NullPointerException
07-14 14:33:53.105: WARN/System.err(13806):
On Wed, Jul 14, 2010 at 8:35 AM, TjerkW tje...@gmail.com wrote:
Works on the emulator.. but on my nexus one i still get the nasty
nullpointerexception deep inside the Android apis
At this point, I am fairly lost with your code. I don't know why you
need onUpdate() to fork a thread. Make sure
Okay i have that now and i still get the nullpointerexception on an
Nexus One.
I still use a separate thread because the client libray i use does a
asyncrhonous api call.
But i syncrhonize it by an object lock.
So it should work fine.. but it doesnt.
On Jul 14, 2:50 pm, Mark Murphy
From what thread are you ultimately calling
AppWidgetManager.updateAppWidget
?
It has to be the UI thread, I think you should check to make sure.
-- Kostya
14.07.2010 16:35, TjerkW пишет:
Works on the emulator.. but on my nexus one i still get the nasty
nullpointerexception deep inside the
On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyev kmans...@gmail.com wrote:
From what thread are you ultimately calling
AppWidgetManager.updateAppWidget
?
It has to be the UI thread, I think you should check to make sure.
No, it doesn't. I have a few examples where updating the app widget
Im calling it from the IntentService onHandleIntent method which
should run in its own worker thread as the apidocs explain.
It works on the emulator.
However on the Nexus One i get the nullpointer exception on calling
manager.updateAppWidget ...
See the stacktrace in a previous post.
On Jul 14,
Mark,
AFAIK, all UI methods are supposed to be called from the UI thread, are
widget calls an exception to this rule?
-- Kostya
14.07.2010 17:12, Mark Murphy пишет:
On Wed, Jul 14, 2010 at 9:01 AM, Kostya Vasilyevkmans...@gmail.com wrote:
From what thread are you ultimately calling
On Wed, Jul 14, 2010 at 9:27 AM, Kostya Vasilyev kmans...@gmail.com wrote:
AFAIK, all UI methods are supposed to be called from the UI thread, are
widget calls an exception to this rule?
An app widget has nothing to do with the UI...from your application's
standpoint.
The home screen probably
Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.
However maybe this output from LogCat also helps:
07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14 15:57:58.845: ERROR/ActivityManager(59): Reason: Broadcast of
Intent {
Right, actual views live in a separate process altogether and
RemoteViews is marshalled to this process... That's understood.
But an AppWidgetProvider is a broadcast receiver, and its methods are
called on a certain thread within the containing process. Is it safe to
call updateAppWidget and
On Wed, Jul 14, 2010 at 10:00 AM, TjerkW tje...@gmail.com wrote:
Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.
However maybe this output from LogCat also helps:
07-14 15:57:58.845: ERROR/ActivityManager(59): ANR in
com.hyves.android.application
07-14
On Wed, Jul 14, 2010 at 10:04 AM, Kostya Vasilyev kmans...@gmail.com wrote:
But an AppWidgetProvider is a broadcast receiver, and its methods are called
on a certain thread within the containing process. Is it safe to call
updateAppWidget and other methods (such as getAppWidgetIds) from a
Aaah cool i didnt think of that problem!
On Jul 14, 2010, at 4:15 PM, Mark Murphy wrote:
On Wed, Jul 14, 2010 at 10:00 AM, TjerkW tje...@gmail.com wrote:
Hmm yeah,.. im trying to make a simple widget now and adding more
stuff.
However maybe this output from LogCat also helps:
07-14
... which is in turn caused by a crash:
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): FATAL EXCEPTION:
Thread-16
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
07-14 10:30:36.796: ERROR/AndroidRuntime(12077): at
android.widget.RemoteViews
Thanks... it was not a threading issue... i was calling
views.setImageViewBitmap(R.id.profile_image, icon);
with a null icon Most stupid mistake ever.
But i think it would be better if android throws a better exception
with a clear message.
Anyways... solved!
And a lot learned today!
It does -
07-14 10:30:36.796: ERROR/AndroidRuntime(12077):
java.lang.NullPointerException
How more specific can you get?
-- Kostya
14.07.2010 19:42, TjerkW пишет:
Thanks... it was not a threading issue... i was calling
views.setImageViewBitmap(R.id.profile_image, icon);
with a null
The problem was that sometimes the icon was not null and sometimes it was...
so was searching for a threading issue.
You could be more specific to throw a nullpointerexception straight away in
the api. NullPointerException(media cannot be null).
But that requires some cpu cycles...
2010/7/14
23 matches
Mail list logo