Thanks so much for the help. I works great now.
On 1 Okt, 22:37, Kostya Vasilyev <kmans...@gmail.com> wrote: > Sure. Toast.makeText(context, int, ...) takes a string resource id as > its second parameter. > > What you want is: > > Toast.makeText(context, "The value is: " + String.valueOf(msg.arg1), ... ); > > Or msg.arg2, or msg.what, depending on what exactly you'd like to log. > > And, as a debugging aid, you might as well use logging: > > Log.i("MyApp", "The value of x is " + String.valueOf(x)); > > This will get printed into the logcat, which can be viewed in Eclipse's > DDMS perspective (or outside: "adb logcat" in your operating system's > command line window). > > -- Kostya > > 02.10.2011 0:17, Kristoffer пишет: > > > > > > > Thanks for the reply, but it gives me this error message: > > > android.content.res.Resources$NotFoundException:String resource ID > > #0x1 > > > Did i do it wrong? > > > this is the part i changed > > > msg.arg1 = 1; > > > - - - - - > > > Toast.makeText(getApplicationContext(), msg.arg1 , > > Toast.LENGTH_LONG).show(); > > > On 1 Okt, 21:57, Mark Murphy<mmur...@commonsware.com> wrote: > >> 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/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > >> _The Busy Coder's Guide to Android Development_ Version 3.6 Available! > > -- > Kostya Vasilyev -- 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