Android : How to use a String outside onCreate method

on Thursday, April 2, 2015


I have the following code in my onCreate method:



Bundle appleData = getIntent().getExtras();
if(appleData==null) {
return;
}
String appleMessage = appleData.getString("appleMessage");

final TextView texttest = (TextView) findViewById(R.id.texttest);
texttest.setText(appleMessage);


I want to use the string stored in appleMessage in a different method on the same activity that is outside of onCreate, how do I go about doing this?


0 comments:

Post a Comment