class - Android Variable Usage within Classes -
i have class within activity , can not use variables in subclass in activity class. why happening?!
this in subclass:
try { httpresponse response = client.execute(getrequest); inputstream jsonstream = response.getentity().getcontent(); bufferedreader reader = new bufferedreader(new inputstreamreader(jsonstream)); stringbuilder builder = new stringbuilder(); string line; while((line = reader.readline()) != null) { builder.append(line); } string jsondata = builder.tostring(); log.e("data", jsondata); person = new jsonobject(jsondata); email = person.getstring("email"); } catch (clientprotocolexception e) { e.printstacktrace(); log.e("no data", "nothing"); } catch (ioexception e) { e.printstacktrace(); log.e("no data", "nothing"); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace(); } log.e("email", email); return null; }
i right value of email in log.e output when try assign text view string email in activity class, wont work , crashes emulator.
textview myemailview = (textview) findviewbyid(r.id.textview15); myemailview.settext(email);
Comments
Post a Comment