Handler loses message after wait() and notify()

by fugu2.0 » Fri, 23 Apr 2010 08:02:06 GMT

Sponsored Links
 Hey Guys!

I have a problem handling messages in a Thread. My run-method looks
like this

public void run() {
   parserHandler = new Handler {
      public void handleMessage(Message msg) {
         Log.i("","id from message: "+msg.getData.getString("id"));
         // further message handling

I have several Activities sending messages to this thread, like this:

Message parserMessage = new Message();
Bundle data = new Bundle();
data.putString("id", realId);
data.putString("callingClass", "CategoryList");

parserHandler = parser.getParserHandler();

synchronized (parserHandler) {
    Log.i("","message ID:  " +


The problem is that the run-method logs "id from message: null" though
"message ID" has a value in the Log-statement. Why does the message
"lose" it's data when being send to the thread? Has it something to do
with the notify? Thanks for your help


Other Threads

1. can i use javascript localstorage in html5 in android 1.5 or above with WebView?



2. Animation on element in a custom view


I have been trying to take one of the elements that I am drawing in a
custom View class and apply an animation on it.

The custom view itself is essentially a background image that I draw
and some overlay images that I am also drawing in the onDraw method
using canvas.drawBitmap(). It is larger then the screen but I can
scroll around and see it. The overlays are sitting on specific
locations of the background image.

Essentially, I am trying to animate one of the overlay bitmaps (just a
simple fade in / fade out with AlphaAnimation). But am having a hard
time only animating that particular element.

The problem I am having is that the animation is being applied to the
entire view, and I just want this one element to be animated. I have
tried using a seperate view for just that overlay, but that creates
other problems, namely when I do this, only the new view will move
with the screen. If there is a away to combine this view with the main
custom view, perhaps that would also help (such that they both move

I am fairly new with Android, so any assistance would be much


Steven Gillan


3. WebView Problem

4. FYI EVO/Incredible ADB How-To

5. Error Message on missing permissions

6. LiveWallpapers: Delayed posting of Runnable vs full-fledged paint thread

7. Reg. Screen Orientation - Screen Rebuilding Issue