String back from Bundle

不打扰是莪最后的温柔 提交于 2020-01-16 19:20:07

问题


From 1st ACTIVITY

Intent IntentButton = new Intent();
IntentButton.setClass(this, PaliActivity2.class);
IntentButton.putExtra("EditText123", EditText1.getText().toString());
startActivity(IntentButton);

2nd ACTIVITY

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);                     
setContentView(R.layout.nextscreen);
Bundle BundleFrom1 = getIntent().getExtras();

How to get the String back from Bundle received from Activity1???


回答1:


Solution:

String s = BundleFrom1.getString("EditText123");

please name the variables with lower chase beginning



来源:https://stackoverflow.com/questions/7652829/string-back-from-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!