“Android Studio Pass value к другому деятельности” Ответ

Android Studio Pass value к другому деятельности

Intent i = new Intent(this, ActivityTwo.class);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete);
String getrec=textView.getText().toString();

//Create the bundle
Bundle bundle = new Bundle();

//Add your data to bundle
bundle.putString(“stuff”, getrec);

//Add the bundle to the intent
i.putExtras(bundle);

//Fire that second activity
startActivity(i);
Evil Elephant

Android Studio Pass value к другому деятельности

//Get the bundle
Bundle bundle = getIntent().getExtras();

//Extract the data…
String stuff = bundle.getString(“stuff”); 
Evil Elephant

Ответы похожие на “Android Studio Pass value к другому деятельности”

Вопросы похожие на “Android Studio Pass value к другому деятельности”

Больше похожих ответов на “Android Studio Pass value к другому деятельности” по Java

Смотреть популярные ответы по языку

Смотреть другие языки программирования