Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私の中で
onCreate
設定しています
myString = getIntent().getStringExtra("sentString");
それとその後
if (myString == "test") {...}
実行に失敗します...
その後であっても
btnTest.setText(myString);
作品
何が問題ですか?
文字列を比較するときは、常に String.equals() を使用してください。== は参照を比較するだけです。
例: 代わりに
使用する:
if (myString.equals("test")) {...}