我想從一個活動以下三個元素傳遞給另一個:傳遞3個元素(意圖)
在主活性(MainActivity:
String a = "a";
String b = "b";
String c = "c";
我曾嘗試沒有成功以下):
Bundle extras = new Bundle();
extras.putString("a", a);
extras.putString("b", b);
extras.putString("c", c);
Intent intent = new Intent(MainActivity.this, SubActivity.class);
intent.putExtras(extras);
startActivity(intent);
在子活性(子活動):
Bundle extras = new Bundle();
String a = extras.getString("a");
String b = extras.getString("b");
String c = extras.getString("c");