-4

如,

公共无效 ShowConventView2(){

     setContentView(R.layout.main);

     String usr = "happy"; }

如何将 usr 的值传递给 ShowConventView3 ?如果 ShowConventView3 是

公共无效 ShowConventView3(){

     setContentView(R.layout.second);

     TextView txt = (TextView)findViewById(R.id.textView1);

     txt.setText(usr); }

非常感谢。

4

1 回答 1

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); 
}
于 2012-12-18T08:30:21.997 回答