Fixed bug 2759 - Android findLibrary() returns NULL

Sylvain

extra patch with minor modifications:
- typo
- cancel-able set to false
- add the error message, so that the user can report it.
This commit is contained in:
Philipp Wiesemann 2014-10-24 11:53:34 +02:00
parent bc382e390a
commit 1745116fe8

View File

@ -119,20 +119,26 @@ public class SDLActivity extends Activity {
mSingleton = this; mSingleton = this;
// Load shared libraries // Load shared libraries
String errorMsgBrokenLib = "";
try { try {
loadLibraries(); loadLibraries();
} catch(UnsatisfiedLinkError e) { } catch(UnsatisfiedLinkError e) {
System.err.println(e.getMessage()); System.err.println(e.getMessage());
mBrokenLibraries = true; mBrokenLibraries = true;
errorMsgBrokenLib = e.getMessage();
} catch(Exception e) { } catch(Exception e) {
System.err.println(e.getMessage()); System.err.println(e.getMessage());
mBrokenLibraries = true; mBrokenLibraries = true;
errorMsgBrokenLib = e.getMessage();
} }
if (mBrokenLibraries) if (mBrokenLibraries)
{ {
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this); AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall."); dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall."
+ System.getProperty("line.separator")
+ System.getProperty("line.separator")
+ "Error: " + errorMsgBrokenLib);
dlgAlert.setTitle("SDL Error"); dlgAlert.setTitle("SDL Error");
dlgAlert.setPositiveButton("Exit", dlgAlert.setPositiveButton("Exit",
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {