Android Json tag into String -


i use code reading tag specific url:

public static string ter(final string private) {     jsonparser parser = new jsonparser();     try {         object obj = parser.parse(new filereader("my url string"));         jsonobject jsonobject = (jsonobject) obj;         string event = (string) jsonobject.get("event");         return event;     } catch (exception e) {         e.printstacktrace();     }     return private; } 

then set subtitle private in way:

getactionbar().setsubtitle("test"+ter(private)); 

but when run app, in subtitle read text "test" text "null" , doesn't read tag of json. has idea? code wrong?

because may have not initializes variable therefore pointing towards null values....

when ever create object,either calling method or initializing variable @ declaration, can avoid null pointer exception...

please refer post


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -