I'm processing some data in the background using runOnUiThread
but the value for variable (ishr
) which is being used in processing is getting null
at the end.
I tried to debug it, every thing works fine and value is present in the runOnUiThread
block but it is null
when it comes out of it, is there a way to get the values in mainUI ?
public String ishra="";
TextView ish = (TextView) findViewById(R.id.ish);
runOnUiThread(new Runnable(){
@Override
public void run(){
processdata.in.background(result);
}
});
ish.setText(ishra);
process.data.in.background(String match)
{
if (match=="True"){
getdatafromhttp();
processdata(resultfromhttp);
}
}
private void processdata(String data)
{
try
{
JSONObject json = new JSONObject(data);
JSONObject a = json.getJSONObject("data");
ishra = a.getString("Surprise");
}
catch (JSONException e)
{
Log.wtf("log", e);
}
}