あるアクティビティから別のアクティビティに文字列を渡そうとしています。インテントから余分なフォームを取得できないようです。どこが間違っていますか?
ここにコードがあります
エクストラをインテントに入れるには:
public void onClick(View v) {
// TODO Auto-generated method stub
String string = editTextFeild.getText().toString();
Intent i = new Intent("com.com.com.otherclass");
i.putExtra("dat", string);
startActivity(new Intent("com.com.com.otherclass"));
}
インテントからデータを取得するには (com.com.com.otherclass 内):
Bundle bundle = getIntent().getExtras();
if (bundle != null){
String string = bundle.getString("dat");
textView.setText(string);
}
psこれらは、コードで使用する実際の名前ではありません:)
前もって感謝します :)