|
5 | 5 | import android.graphics.Color; |
6 | 6 | import android.os.Bundle; |
7 | 7 | import android.util.Log; |
8 | | -import android.view.ContextThemeWrapper; |
| 8 | +import android.widget.Toast; |
9 | 9 | import android.view.View; |
10 | 10 | import android.widget.Button; |
11 | 11 | import android.widget.EditText; |
@@ -268,16 +268,11 @@ public void handleInstallation(Context context, ModDetail modDetail, int selecte |
268 | 268 | try { |
269 | 269 | DownloadUtils.downloadFile(url, destFile); |
270 | 270 | ProgressLayout.clearProgress(ProgressLayout.INSTALL_MODPACK); |
271 | | - Tools.runOnUiThread(() -> { |
272 | | - // context here is getApplicationContext() from ModItemAdapter — |
273 | | - // must wrap with AppTheme or AlertDialog crashes on Android 9 |
274 | | - Context themedCtx = new ContextThemeWrapper(context, R.style.AppTheme); |
275 | | - new AlertDialog.Builder(themedCtx) |
276 | | - .setTitle(modDetail.title) |
277 | | - .setMessage(context.getString(R.string.mod_install_success, finalFileName)) |
278 | | - .setPositiveButton(android.R.string.ok, null) |
279 | | - .show(); |
280 | | - }); |
| 271 | + Tools.runOnUiThread(() -> |
| 272 | + Toast.makeText(context, |
| 273 | + context.getString(R.string.mod_install_success, finalFileName), |
| 274 | + Toast.LENGTH_LONG).show() |
| 275 | + ); |
281 | 276 | } catch (Exception e) { |
282 | 277 | ProgressLayout.clearProgress(ProgressLayout.INSTALL_MODPACK); |
283 | 278 | Tools.showErrorRemote(context, R.string.modpack_install_download_failed, e); |
|
0 commit comments