Verify freezing is not a context / thread issue

This commit is contained in:
TwistedUmbrella 2015-01-31 01:43:40 -05:00
parent cb555bc06f
commit 21fbad3ba5
2 changed files with 20 additions and 4 deletions

View File

@ -22,7 +22,8 @@
<string name="missing_flash">The Dreamcast Flash is missing. A dump of the Dreamcast Flash is required for this emulator to work. Make sure the Flash file is named "dc_flash.bin" and is in %1$s/data/dc_flash.bin</string>
<string name="require_bios">You have to provide a Dreamcast BIOS.</string>
<string name="data_folder">The current data folder is assumed.</string>
<string name="emu_crash">Emulator Error:\n %1$s</string>
<string name="emu_crash">Emulator Error!</string>
<string name="emu_toast">Emulator Error:\n %1$s</string>
<string name="folder_bios">Boot BIOS</string>
<string name="folder_select">Select current folder</string>

View File

@ -10,7 +10,9 @@ import javax.microedition.khronos.opengles.GL10;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Paint;
@ -692,9 +694,22 @@ public class GL2JNIView extends GLSurfaceView
handler.post(new Runnable() {
public void run() {
Log.d(context.getApplicationContext().getPackageName(), msg);
MainActivity.showToastMessage(context,
context.getString(R.string.emu_crash, msg),
Toast.LENGTH_LONG);
// MainActivity.showToastMessage(context,
// context.getString(R.string.emu_toast, msg),
// Toast.LENGTH_LONG);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);
alertDialogBuilder.setTitle(context.getString(R.string.emu_crash));
alertDialogBuilder
.setMessage(msg)
.setCancelable(false)
.setPositiveButton("Okay...",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, close current activity
// MainActivity.this.finish();
}
});
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
}
});
}