Don't do:

msg.what=1

Do:

msg.arg1=1

Then, on the receiving side, your value will be:

msg.arg1

On Sat, Oct 1, 2011 at 3:29 PM, Kristoffer <kris.isak.v...@gmail.com> wrote:
> Hello.
>
> Iam having some trouble sending message from a thread back to the
> "main" thread.
>
> I just need to send a integer just so i know what just happend in the
> thread.
>
> This is what i use right now,
>
> Message msg = Message.obtain();
> msg.what = 1;
> progressHandler.sendMessage(msg);
>
> - - - - -
>
> private Handler progressHandler = new Handler() {
> @Override
> public void handleMessage(Message msg) {
>
> Toast.makeText(getApplicationContext(), msg.toString(),
> Toast.LENGTH_LONG).show();
>
> This will show me:
> { what=1 when=somenumbers }
>
> Is there a way so i just could "grabb" the Int 1 in this case?
>
> Iam then going to build if statments depends on the integer
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to