2016-04-01 22 views

答えて

0

、単にから、例えばC.

を起動するために使用者の意図に余分を渡す:

Intent launch_from_a = new Intent(this, ActivityC.class); 
launch_from_a.putExtra("from", "ActivityA"); 

そしてBから:

Intent launch_from_b = new Intent(this, ActivityC.class); 
launch_from_b.putExtra("from", "ActivityB"); 

およびC:

Intent intent = getIntent(); 
String from = intent.getStringExtra("from"); 
if ("ActivityA".equals(from)) { 
} 
else if ("ActivityB".equals(from)) { 
} 
0

別approchが)活性A(OnCreateイベントでsmewhere())にstatic String act = "a"状の部​​材を宣言し、それはまた、OnCreateイベントでの活動B A.act = "b"((中値だ上書きすることである。活動のCでは、あなたが、それは価値のテストありがとうございます。 AとBの両方において

関連する問題