I want to show AlertDialog.Builder
for checking internet its working fine in android 5 and above but below version its showing exception like this
02-01 12:11:49.805 3220-3220/com.iglulabs.medine1 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.iglulabs.medine1, PID: 3220
java.lang.NoClassDefFoundError: com.iglulabs.medine1.utils.Utility$6
at com.iglulabs.medine1.utils.Utility.showExistingEmailUserLoginDialog(Utility.java:1116)
at com.iglulabs.medine1.activity.LoginActivity.onClick(LoginActivity.java:661)
at android.view.View.performClick(View.java:4446)
at android.view.View$PerformClick.run(View.java:18437)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5447)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:970)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
at dalvik.system.NativeStart.main(Native Method)
i tried a lot but i am not able to find the solution please help me to solve this problem.
my code is
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(LoginActivity.this, R.style.MyAlertDialogStyle);
dialogBuilder.setTitle(title);
dialogBuilder.setMessage(message);
dialogBuilder.setCancelable(false);
dialogBuilder.setPositiveButton("Proceed", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
((AlertResult.RedeemPointResult) processResult).alertResult(true);
}
});
dialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
((AlertResult.RedeemPointResult) processResult).alertResult(false);
}
});
dialogBuilder.show();
Use Multidex
ref this link
Multidex