jeudi 2 avril 2015

How to use a String outside onCreate method

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?


Aucun commentaire:

Enregistrer un commentaire