开发者

String back from Bundle

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???


Solution:

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

please name the variables with lower chase beginning

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜