[android-developers] Show output on screen.
How do I get the output to show on the screen? I know that Sytem,out.println goes to the log, I have tried toasts, and other things, I am looking for some suggestions here. How do I implement a Textview. Please be as specific as possible. Thanks if ("1".equals(PleaseEnter.getText().toString())) { System.out.println("This is 1"); } else if (PleaseEnter.equals("2")) System.out.println("This 2"); else if (PleaseEnter.equals("3")) System.out.println("This 3"); else System.out.println("That number is not recognized."); }} catch (Exception ex) -- 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
[android-developers] Show output on screen
Hi, First create a textview in main.xml if you want to see the msg displayed on main. and in your activity class, you can access that textview using this code TextView t = (TextView)findViewById(R.id.textView1);//textView1 is the id of textview that you have created in main.xml t.setText("This is 1"); It should be helpful. Try it out. -- Thanks & Regards, Sowmya Kukkadapu -- 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
Re: [android-developers] Show output on screen.
What "screen" are you talking about. If you're talking about the UI that's typically hooked up to the app, then the answer is that you do need to use these .setText() methods (etc...) that you see from rhaazy's comment. Instead, if you're trying to output to the Log you can use the Log.e/i/d/etc... utilities that will let you track app behavior. So, which screen? kris On Thu, Feb 23, 2012 at 3:09 PM, Ma wrote: > How do I get the output to show on the screen? I know that > Sytem,out.println goes to the log, I have tried toasts, and other > things, I am looking for some suggestions here. How do I implement a > Textview. Please be as specific as possible. > Thanks > > > if ("1".equals(PleaseEnter.getText().toString())) > > { > > System.out.println("This is 1"); > } > else if (PleaseEnter.equals("2")) > System.out.println("This 2"); > else if (PleaseEnter.equals("3")) > System.out.println("This 3"); > else > System.out.println("That number is not recognized."); > }} > catch (Exception ex) > > -- > 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 -- 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
Re: [android-developers] Show output on screen.
you can write Toast.makeText(WalkieTalkieActivity.this,"hello." , 200).show(); this will display as message on screen. Or if you want ti display on ui screen that use the textview and set text to that textview. On Fri, Feb 24, 2012 at 1:39 AM, Ma wrote: > How do I get the output to show on the screen? I know that > Sytem,out.println goes to the log, I have tried toasts, and other > things, I am looking for some suggestions here. How do I implement a > Textview. Please be as specific as possible. > Thanks > > > if ("1".equals(PleaseEnter.getText().toString())) > > { > > System.out.println("This is 1"); >} > else if (PleaseEnter.equals("2")) >System.out.println("This 2"); > else if (PleaseEnter.equals("3")) >System.out.println("This 3"); > else > System.out.println("That number is not recognized."); > }} > catch (Exception ex) > > -- > 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 > -- 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