Saturday, November 9, 2019

Sending data from one activity to other using bundle

Send data from  Activity

Intent intent =new Intent(this,nextactvitiy.class);
Bundle bundle=new Bundle();
bundle.putString("key",value);
bundle.putString("another key",another value);
intent.putExtras(bundle);
startactivity(intent);


Get data in another Activity

Bundle bundle=getIntent().getExtras();
String s =bundle.getString("key");
String s2=bundle.getString("key2");

No comments:

Alert Dialog Box

Alert Dialog Box Android AlertDialog   can be used to display the dialog message with OK and Cancel buttons. It can be used to inter...