assets/src/org/ruboto/SplashActivity.java in ruboto-1.1.2 vs assets/src/org/ruboto/SplashActivity.java in ruboto-1.2.0
- old
+ new
@@ -44,28 +44,28 @@
}
super.onCreate(bundle);
}
public void onResume() {
- Log.d("onResume: ");
+ Log.d("SplashActivity onResume: ");
if (!JRubyAdapter.isInitialized() && receiver == null) {
registerPackageInstallReceiver();
}
super.onResume();
}
public void onPause() {
- Log.d("onPause: ");
+ Log.d("SplashActivity onPause: ");
if (receiver != null) {
unregisterReceiver(receiver);
receiver = null;
}
super.onPause();
}
public void onDestroy() {
- Log.d("onDestroy: ");
+ Log.d("SplashActivity onDestroy: ");
super.onDestroy();
if (dialogCancelled) {
System.runFinalizersOnExit(true);
System.exit(0);
}
@@ -75,21 +75,21 @@
showProgress();
new Thread(new Runnable() {
public void run() {
final boolean jrubyOk = JRubyAdapter.setUpJRuby(SplashActivity.this);
if (jrubyOk) {
- Log.d("onResume: JRuby OK");
+ Log.d("SplashActivity onResume: JRuby OK");
startUserActivity();
} else {
registerPackageInstallReceiver();
runOnUiThread(new Runnable() {
public void run() {
if (localFile.exists()) {
installDownload();
} else {
if (firstTime) {
- Log.d("onResume: Checking JRuby - IN UI thread");
+ Log.d("SplashActivity onResume: Checking JRuby - IN UI thread");
try {
setContentView(Class.forName(getPackageName() + ".R$layout").getField("get_ruboto_core").getInt(null));
if (hasInternetPermission()) {
getRubotoCore(null);
return;
@@ -97,11 +97,11 @@
} catch (Exception e) {
}
} else {
Toast.makeText(SplashActivity.this,"Failed to initialize Ruboto Core.",Toast.LENGTH_LONG).show();
try {
- TextView textView = (TextView) findViewById(Class.forName(getPackageName() + ".R$id").getField("text").getInt(null));
+ TextView textView = (TextView) findViewById(android.R.id.text1);
textView.setText("Woops! Ruboto Core was installed, but it failed to initialize properly! I am not sure how to proceed from here. If you can, please file an error report at http://ruboto.org/");
} catch (Exception e) {
}
}
}
@@ -132,11 +132,11 @@
// FIXME(uwe): Also set total bytes and bytes downloaded.
loadingDialog.setProgress(getProgressPercentage());
try {
Thread.sleep(1000);
} catch (InterruptedException ie) {
- Log.e("Interupted!");
+ Log.e("SplashActivity Interupted!");
}
}
}
}).start();
}
@@ -162,14 +162,14 @@
}
private void showProgress() {
if (loadingDialog == null) {
if (splash > 0) {
- Log.i("Showing splash");
+ Log.i("SplashActivity Showing splash");
setContentView(splash);
} else {
- Log.i("Showing progress");
+ Log.i("SplashActivity Showing progress");
loadingDialog = ProgressDialog.show(this, null, "Starting...", true, true);
loadingDialog.setCanceledOnTouchOutside(false);
loadingDialog.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
dialogCancelled = true;
@@ -181,14 +181,14 @@
}
private void showDownloadProgress(String message) {
if (loadingDialog == null) {
if (splash > 0) {
- Log.i("Showing splash");
+ Log.i("SplashActivity Showing splash");
setContentView(splash);
} else {
- Log.i("Showing progress");
+ Log.i("SplashActivity Showing progress");
loadingDialog = new ProgressDialog(this);
loadingDialog.setTitle(null);
loadingDialog.setMessage(message);
loadingDialog.setIndeterminate(false);
loadingDialog.setMax(100);
@@ -208,11 +208,11 @@
}
}
private void hideProgress() {
if (loadingDialog != null) {
- Log.d("Hide progress");
+ Log.d("SplashActivity Hide progress");
loadingDialog.dismiss();
loadingDialog = null;
}
}
@@ -325,24 +325,24 @@
startActivityForResult(installIntent, INSTALL_REQUEST_CODE);
}
// EMXIF
public void onActivityResult(int requestCode, int resultCode, Intent data) {
- Log.d("onActivityResult: " + requestCode + ", " + resultCode + ", " + data);
- Log.d("onActivityResult: " + INSTALL_REQUEST_CODE + ", " + RESULT_OK + ", " + RESULT_CANCELED);
+ Log.d("SplashActivity onActivityResult: " + requestCode + ", " + resultCode + ", " + data);
+ Log.d("SplashActivity onActivityResult: " + INSTALL_REQUEST_CODE + ", " + RESULT_OK + ", " + RESULT_CANCELED);
if (requestCode == INSTALL_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
- Log.d("onActivityResult: Install OK.");
+ Log.d("SplashActivity onActivityResult: Install OK.");
} else if (resultCode == RESULT_CANCELED) {
- Log.d("onActivityResult: Install canceled.");
+ Log.d("SplashActivity onActivityResult: Install canceled.");
// FIXME(uwe): Maybe show a dialog explaining that RubotoCore is needed and try again?
deleteFile(RUBOTO_APK);
if (!JRubyAdapter.isInitialized()) {
finish();
}
// EMXIF
} else {
- Log.e("onActivityResult: resultCode: " + resultCode);
+ Log.e("SplashActivity onActivityResult: resultCode: " + resultCode);
}
}
super.onActivityResult(requestCode, resultCode, data);
}