Commit 80470749 authored by TwistedUmbrella's avatar TwistedUmbrella
Browse files

Let them reboot if they ignore the warning. At least we tried

parent ee886608
......@@ -4,7 +4,6 @@ import java.io.File;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.List;
import tv.ouya.console.api.OuyaFacade;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
......@@ -351,81 +350,80 @@ public class MainActivity extends SlidingFragmentActivity implements
if (GenerateLogs.readOutput("uname -a").equals(getString(R.string.error_kernel))) {
Toast.makeText(MainActivity.this, R.string.unsupported,
Toast.LENGTH_SHORT).show();
} else {
String msg = null;
if (!isBiosExisting())
msg = getString(R.string.missing_bios, home_directory);
else if (!isFlashExisting())
msg = getString(R.string.missing_flash, home_directory);
if (msg != null) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this);
// set title
alertDialogBuilder.setTitle("You have to provide the BIOS");
// set dialog message
alertDialogBuilder
.setMessage(msg)
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
// MainActivity.this.finish();
}
})
.setNegativeButton("Options",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
FileBrowser firstFragment = new FileBrowser();
Bundle args = new Bundle();
// args.putBoolean("ImgBrowse", false);
// specify ImgBrowse option. true = images,
// false = folders only
args.putString("browse_entry",
sdcard.toString());
// specify a path for selecting folder
// options
args.putBoolean("games_entry", false);
// selecting a BIOS folder, so this is not
// games
firstFragment.setArguments(args);
// In case this activity was started with
// special instructions from
// an Intent, pass the Intent's extras to
// the fragment as arguments
// firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the
// 'fragment_container' FrameLayout
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container,
firstFragment,
"MAIN_BROWSER")
.addToBackStack(null).commit();
}
});
}
String msg = null;
if (!isBiosExisting())
msg = getString(R.string.missing_bios, home_directory);
else if (!isFlashExisting())
msg = getString(R.string.missing_flash, home_directory);
if (msg != null) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this);
// set title
alertDialogBuilder.setTitle("You have to provide the BIOS");
// set dialog message
alertDialogBuilder
.setMessage(msg)
.setCancelable(false)
.setPositiveButton("Dismiss",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// if this button is clicked, close
// current activity
// MainActivity.this.finish();
}
})
.setNegativeButton("Options",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
FileBrowser firstFragment = new FileBrowser();
Bundle args = new Bundle();
// args.putBoolean("ImgBrowse", false);
// specify ImgBrowse option. true = images,
// false = folders only
args.putString("browse_entry",
sdcard.toString());
// specify a path for selecting folder
// options
args.putBoolean("games_entry", false);
// selecting a BIOS folder, so this is not
// games
firstFragment.setArguments(args);
// In case this activity was started with
// special instructions from
// an Intent, pass the Intent's extras to
// the fragment as arguments
// firstFragment.setArguments(getIntent().getExtras());
// Add the fragment to the
// 'fragment_container' FrameLayout
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.fragment_container,
firstFragment,
"MAIN_BROWSER")
.addToBackStack(null).commit();
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
// show it
alertDialog.show();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNINative.class));
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNINative.class));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNIActivity.class));
}
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
GL2JNIActivity.class));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment