1414
1515public class NotificationDownloadListener implements ModloaderDownloadListener {
1616 private final Context mContext ;
17+ private final Intent mIntent ;
1718 private final ModLoader mModLoader ;
1819
1920 public NotificationDownloadListener (Context context , ModLoader modLoader ) {
2021 mModLoader = modLoader ;
2122 mContext = context .getApplicationContext ();
23+ mIntent = new Intent (mContext , LauncherActivity .class );
2224 }
2325
2426 @ Override
2527 public void onDownloadFinished (File downloadedFile ) {
2628 if (mModLoader .requiresGuiInstallation ()) {
2729 ModloaderInstallTracker .saveModLoader (mContext , mModLoader , downloadedFile );
28- Intent mainActivityIntent = new Intent (mContext , LauncherActivity .class );
29- sendIntentNotification (mainActivityIntent , R .string .modpack_install_notification_success );
30+ sendIntentNotification (R .string .modpack_install_notification_success );
3031 }
3132 }
3233
@@ -40,11 +41,11 @@ public void onDownloadError(Exception e) {
4041 Tools .showErrorRemote (mContext , R .string .modpack_install_modloader_download_failed , e );
4142 }
4243
43- private void sendIntentNotification (Intent intent , int localeString ) {
44+ private void sendIntentNotification (int localeString ) {
4445 Tools .runOnUiThread (() -> NotificationUtils .sendBasicNotification (mContext ,
4546 R .string .modpack_install_notification_title ,
4647 localeString ,
47- intent ,
48+ mIntent ,
4849 NotificationUtils .PENDINGINTENT_CODE_DOWNLOAD_SERVICE ,
4950 NotificationUtils .NOTIFICATION_ID_DOWNLOAD_LISTENER
5051 ));
@@ -54,7 +55,7 @@ private void sendEmptyNotification(int localeString) {
5455 Tools .runOnUiThread (()->NotificationUtils .sendBasicNotification (mContext ,
5556 R .string .modpack_install_notification_title ,
5657 localeString ,
57- null ,
58+ mIntent ,
5859 NotificationUtils .PENDINGINTENT_CODE_DOWNLOAD_SERVICE ,
5960 NotificationUtils .NOTIFICATION_ID_DOWNLOAD_LISTENER
6061 ));
0 commit comments