Android 未将布尔变量传递给getBoolean变量

Android 未将布尔变量传递给getBoolean变量,android,bundle,Android,Bundle,我不确定为什么timermagics变量的值为false和not true您使用设置布尔值,因此: Intent i = new Intent(AndroidGUIActivity.this, Basic_database_questionsActivity.class); Bundle b = new Bundle(); // get the current value of timerStart variable and store it in timerlogic Log.e(LOGS,

我不确定为什么timermagics变量的值为false和not true

您使用设置布尔值,因此:

Intent i = new Intent(AndroidGUIActivity.this, Basic_database_questionsActivity.class);
Bundle b = new Bundle();
// get the current value of timerStart variable and store it in timerlogic
Log.e(LOGS, "Whatis the value of timerstart inside the intentcalls method" +  timerStart);
b.getBoolean("timerlogic", timerStart);
boolean timermagic= b.getBoolean("timerlogic");
Log.e(LOGS, "Whatis the value of timerstart passed to timermagic" + timermagic);
应该是:

b.getBoolean("timerlogic", timerStart);
您可以使用设置布尔值,因此:

Intent i = new Intent(AndroidGUIActivity.this, Basic_database_questionsActivity.class);
Bundle b = new Bundle();
// get the current value of timerStart variable and store it in timerlogic
Log.e(LOGS, "Whatis the value of timerstart inside the intentcalls method" +  timerStart);
b.getBoolean("timerlogic", timerStart);
boolean timermagic= b.getBoolean("timerlogic");
Log.e(LOGS, "Whatis the value of timerstart passed to timermagic" + timermagic);
应该是:

b.getBoolean("timerlogic", timerStart);