Browse files

show Motorola license message box only on start of application

  • Loading branch information...
1 parent dbb7e9d commit e9239701ac4fc81ada891a75ed74791869728697 @dmitrys dmitrys committed May 9, 2012
Showing with 27 additions and 24 deletions.
  1. +27 −24 platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
View
51 platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
@@ -131,6 +131,32 @@ protected void onCreate(Bundle savedInstanceState) {
notifyUiCreated();
RhodesApplication.stateChanged(RhodesApplication.UiState.MainActivityCreated);
+
+
+ if (!isPassMotoLicence()) {
+ Logger.E(TAG, "############################");
+ Logger.E(TAG, " ");
+ Logger.E(TAG, "ERROR: motorola_license is INVALID !");
+ Logger.E(TAG, " ");
+ Logger.E(TAG, "############################");
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setCancelable(true);
+ b.setOnCancelListener( new DialogInterface.OnCancelListener() {
+ public void onCancel(DialogInterface dialog) {
+ //RhodesService.exit();
+ }
+ });
+ AlertDialog securityAlert = b.create();
+ securityAlert.setMessage("Please provide RhoElements license key.");
+ securityAlert.setButton("OK", new DialogInterface.OnClickListener(){
+ public void onClick(DialogInterface arg0, int arg1) {
+ //RhodesService.exit();
+ }
+
+ });
+ securityAlert.show();
+ return;
+ }
}
public IRhoWebView createWebView() {
@@ -447,30 +473,7 @@ public void onClick(DialogInterface arg0, int arg1) {
*/
return;
}
- if (!isPassMotoLicence()) {
- Logger.E(TAG, "############################");
- Logger.E(TAG, " ");
- Logger.E(TAG, "ERROR: motorola_license is INVALID !");
- Logger.E(TAG, " ");
- Logger.E(TAG, "############################");
- AlertDialog.Builder b = new AlertDialog.Builder(this);
- b.setCancelable(true);
- b.setOnCancelListener( new DialogInterface.OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- //RhodesService.exit();
- }
- });
- AlertDialog securityAlert = b.create();
- securityAlert.setMessage("Please provide RhoElements license key.");
- securityAlert.setButton("OK", new DialogInterface.OnClickListener(){
- public void onClick(DialogInterface arg0, int arg1) {
- //RhodesService.exit();
- }
-
- });
- securityAlert.show();
- return;
- }
+
// String urlStart = uri.getPath();
// if (urlStart != null) {

0 comments on commit e923970

Please sign in to comment.