문제

is there a way to tell Android that I would like subsequent calls to startActivity() all resume the target activity rather than creating it over and over again ? Any workarounds ?

Thanks

도움이 되었습니까?

해결책

Depending on your needs, try using FLAG_ACTIVITY_CLEAR_TOP or FLAG_ACTIVITY_REORDER_TO_FRONT when creating your intent:

Intent intent = new Intent(this, NameOfActivityClass.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top