I have a Inner class which extends AsyncTask inside my main class
public class MainActivity extends Activity {
String variable;
public onCreate(){
onClickListener{
new InnerClass().execute(params);
variable // Here the value is always null
}
}
class InnerClass extends AsyncTask<String,Void,JSONObject>{
protected JSONObject doInBackground(String... params){
/* Relevant Code
*/
}
protected void onPostExecute(JSONObject result){
variable = value; // required value being assigned to the variable
}
}
}
I am getting proper value assigned to the my String Variable "variable" in the inner class, but i am not able to the access the value in my main class.