I want to make use two variables in next Activity but thread make it null
Here in my application I want to use 2 variables which I want to use in another activity. But in first activity I make thread for progress dialog bar but in thread I call one xml and get开发者_如何学Python data from web service but thease two variables make null after end of thread. So please help me.
You need to add them to the Intent that is calling the 2nd activity and then read them back:
e.g. for writing:
Intent i = new Intent(this, NewTweetActivity.class);
i.putExtra("op", "I want to transport this");
startActivity(i);
and for reading back:
Bundle bundle = getIntent().getExtras();
if (bundle!=null) {
String op = bundle.getString("op");
精彩评论