android - variable initialization failure -


as know asynctask works background thread , returns control gui when task complete , requests through volley can made in main activity thread , lets assign json response string variable upon completion of request , string null , program further processes reponse, problem got was thrown nullpointerexception while processing response string after successful response , absurd possible if response slow program may continue without initializing string variable ??

it sounds not using proper callback on data. in other words, after start asynctask, have wait until done until reference global variables might impact.

so, if didn't write proper callback method, yes program continue. idea behind asynctask - let thread called on continue while long process of kind.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -