2011-01-09 21 views
0
Intent myIntent = new Intent(Main.this, Selected.class); 

Main.this.startActivity(myIntent); myIntent.putExtra(「NAME」,「yeah」);我的意圖不給我什麼

當我想找回「是啊」我在其他類不起作用

test = (TextView)findViewById(R.id.test); 
    String myIntentString = icicle !=null? icicle.getString("NAME"):null; 
    if(myIntentString==null){ 
     Bundle extras = getIntent().getExtras(); 
     myIntentString = extras != null ? extras.getString("NAME") : "nothing passed in"; 

    } 
     test.setText(myIntentString); 

回答

3

我想你可能有倒上把多餘和啓動活動的順序。

myIntent.putExtra("NAME", "yeah"); 
Main.this.startActivity(myIntent); 
0

您是否在清單文件中包含了「.Selected」?

+0

是的,但我想我會像其他答案顛倒順序。 – Tsunaze 2011-01-10 08:52:28

相關問題