I am making a program in which i need to pass a value from one activity to another using an Intent between activities.
So here is my question How to Pass and Get an Intent into another activity.
See my below code, using button click i want to pass an intent to another activity..
FirstActivity.java:
public class FirstActivity extends Activity {
// Initializing variables
EditText inputName;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen1);
inputName = (EditText) findViewById(R.id.name);
Button btnNextScreen = (Button) findViewById(R.id.btnNextScreen);
//Listening to button event
btnNextScreen.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
//Code to start a new Intent and to pass value
}
});
}