phoenix2025
Lurker
Hello
I come to you because I have one problem and all my tentative doesn't solve my problem.
I would like to save the value of one textview inside on variable, and reuse this variable to put inside one other.
For the moment my code look like that :
And one thing that I would after it's to save this variable (R) into the cache, for reuse after that the program was closed.
Thanks for your help
I come to you because I have one problem and all my tentative doesn't solve my problem.
I would like to save the value of one textview inside on variable, and reuse this variable to put inside one other.
For the moment my code look like that :
Code:
public class mainresult extends Activity {
TextView h2,h1;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.result);
h1=(TextView)findViewById(R.id.R1);
h2=(TextView)findViewById(R.id.R2);
String R=h2.getText().toString(); // this is the action with problem
if (R==null||R=="0"){
h1.setText("toto");
}
else{
h1.setText(R);
}
}
}
And one thing that I would after it's to save this variable (R) into the cache, for reuse after that the program was closed.
Thanks for your help