앱 재시작(App restart)

Published: by

앱을 재시작 하자

스택오버플로어에서 좀 더 많은 정보를 얻을 수 있다. 위의 재시작 로직보다 좀 더 개선된 버전의 로직을 볼 수 있다. 위의 restart 로직은, Process Phoenix 에서 사용하는 방법이라고 한다.

Process PhoenixJakeWharton이 것으로, 앱을 쉽게 재시작할 수 있게 하는 오픈소스다.

Process Phoenix

Process Phoenix 의 사용법 두가지:

ProcessPhoenix.triggerRebirth(MainActivity.this);
Intent nextIntent = new Intent(MainActivity.this, MainActivity.class);
nextIntent.putExtra(EXTRA_TEXT, "Hello!");
ProcessPhoenix.triggerRebirth(MainActivity.this, nextIntent);