アクティビティ間のインテントを使用して、あるアクティビティから別のアクティビティに値を渡す必要があるプログラムを作成しています。
だからここに私の質問How to Pass and Get an Intent into 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
}
});
}