私はいくつかのエキストラを新しい意図に送りました。そこにバンドルをつかみ、それがnull
ならテストします。たびに値を取得して使用することができますが、それは毎回null
です。Intent Bundleは毎回Nullを返しますか?
誰かがif文で間違っているのを見ることができますか?
Intent i = getIntent();
Bundle b = i.getExtras();
int picked = b.getInt("PICK");
int correct = b.getInt("CORR");
type = b.getString("RAND");
if(b == null || !b.containsKey("WELL")) {
Log.v("BUNDLE", "bun is null");
} else {
Log.v("BUNDLE", "Got bun well");
}
EDIT:バンドルが作成される場所。
Intent intent = new Intent(this, app.pack.son.class);
Bundle b = new Bundle();
b.putInt("PICK", pick);
b.putInt("CORR", corr);
b.putString("RAND", "yes");
intent.putExtras(b);
startActivity(intent);
バンドルを作成(および送信)するコードを入力してください。 –