Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
468 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Solution:

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

please name the variables with lower chase beginning


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...