Try changing this:
t.setText(current); to this: t.setText("test string"); On Tuesday, November 20, 2012 6:43:41 AM UTC-6, Antonis Kanaris wrote: > > > > I am new android developer. > > I am trying this code for access data from my webserver.... > > @Overridepublic void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.activity_main); > > URL url; > try { > url = new URL("http://www.mysite.net/LEDstate.txt"); > > HttpURLConnection urlConnection = (HttpURLConnection) url > .openConnection(); > > InputStream in = urlConnection.getInputStream(); > > InputStreamReader isw = new InputStreamReader(in); > > int data = isw.read(); > while (data != -1) { > char current = (char) data; > data = isw.read(); > //System.out.print(current); > > > TextView t = (TextView) findViewById(R.id.ledstate); > > t.setText(current); > } > } catch (Exception e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > @Overridepublic boolean onCreateOptionsMenu(Menu menu) { > getMenuInflater().inflate(R.menu.activity_main, menu); > return true;} > > } > > But data is not appearing on Screen.There is no change in Textview. > > I have checked Permissions they are ok. > > Any help? Thanks. > -- 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