customizing the 'Google Market error' message in samples
This commit is contained in:
@@ -45,6 +45,21 @@ public class puzzle15Activity extends Activity
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -40,6 +40,21 @@ public class ColorBlobDetectionActivity extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -54,6 +54,21 @@ public class FdActivity extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -63,6 +63,21 @@ public class ImageManipulationsActivity extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -45,6 +45,21 @@ public class Sample1Java extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -52,6 +52,21 @@ public class Sample2NativeCamera extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -43,6 +43,21 @@ public class Sample3Native extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
@@ -51,6 +51,21 @@ public class Sample4Mixed extends Activity {
|
|||||||
ad.show();
|
ad.show();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
/** OpenCV loader cannot start Google Play **/
|
||||||
|
case LoaderCallbackInterface.MARKET_ERROR:
|
||||||
|
{
|
||||||
|
Log.d(TAG, "Google Play service is not accessible!");
|
||||||
|
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create();
|
||||||
|
MarketErrorMessage.setTitle("OpenCV Manager");
|
||||||
|
MarketErrorMessage.setMessage("Google Play service is not accessible!\nTry to install the 'OpenCV Manager' and the appropriate 'OpenCV binary pack' APKs from OpenCV SDK manually via 'adb install file_name.apk' command.");
|
||||||
|
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||||
|
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mAppContext.finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MarketErrorMessage.show();
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
super.onManagerConnected(status);
|
super.onManagerConnected(status);
|
||||||
|
Reference in New Issue
Block a user