,例如,
public void ShowConventView2(){
setContentView(R.layout.main); String usr = "happy"; }
如何将usr的值传递给ShowConventView3?如果ShowConventView3是
public void ShowConventView3(){
setContentView(R.layout.second); TextView txt = (TextView)findViewById(R.id.textView1); txt.setText(usr); }
非常感谢。
答案 0 :(得分:0)
public void ShowConventView2() {
setContentView(R.layout.main);
String usr = "happy";
ShowConventView3(usr);
}
public void ShowConventView3(String text){
setContentView(R.layout.second);
TextView txt = (TextView)findViewById(R.id.textView1);
txt.setText(text);
}