2011. 3. 8. 17:42
A.java
onCreate{
...
Intent intent = new Intent(ctx, B.class);
startActivityForResult(intent, 0);
...
}
public void onActivityResult(int requestCode, int resultCode, Intent intent)
{
super.onActivityResult(requestCode, resultCode, intent);
 
switch(requestCode)
{
case 0:
if(resultCode == RESULT_OK)
{
intent = getIntent();//반복할때
setResult(RESULT_OK,intent);//반복할때
finish();
}
}
}

B.java

Intent intent = getIntent();
setResult(RESULT_OK,intent);
finish();


B에서 위 코드가 실행되면 B와 A가 동시에 꺼짐

반복해서 여러 액티비티가 동시에 꺼지는것도 가능
Posted by newkie