Skip to content

Commit

Permalink
Fix package name when the activities are restarted (#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Aug 5, 2019
1 parent 6f68a9a commit 9856aae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Expand Up @@ -73,6 +73,7 @@ protected void onHandleWork(@NonNull Intent intent) {

if (!otherProcessesFound) {
intent.setClass(CrashReporterService.this, VRBrowserActivity.class);
intent.setPackage(BuildConfig.APPLICATION_ID);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
Expand Down
Expand Up @@ -7,17 +7,20 @@

import androidx.annotation.NonNull;

import org.mozilla.vrbrowser.BuildConfig;
import org.mozilla.vrbrowser.VRBrowserActivity;

public class SystemUtils {

public static final void restart(@NonNull Context context) {
Intent i = new Intent(context, VRBrowserActivity.class);
i.setPackage(BuildConfig.APPLICATION_ID);
context.startActivity(i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK));
}

public static final void scheduleRestart(@NonNull Context context, long delay) {
Intent i = new Intent(context, VRBrowserActivity.class);
i.setPackage(BuildConfig.APPLICATION_ID);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

Expand Down

0 comments on commit 9856aae

Please sign in to comment.