0
Intent myIntent = new Intent(Main.this, Selected.class);
Main.this.startActivity(myIntent); myIntent.putExtra( "NAME"、 "はい");私の意図は私に何も与えない
私はそれが動作しません。私の他のクラスで「うん」を取得したいとき:
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);
はい、私は他の答えのように順序を逆転させるつもりだと思います。 – Tsunaze