daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Dec 25th, 2012 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      jclass alertDialog_builder_class = env->FindClass("android/app/AlertDialog/Builder");
  2.  
  3.      jmethodID alertDialog_builder_ctor_method = env->GetMethodID("<init>", "(Landroid/content/Context;)v");
  4.      jmethodID alertDialog_builder_setTitle_method = env->GetMethodID("setTitle", "(Ljava/lang/CharSequence;)Landroid/app/AlertDialog/Builder;");
  5.      jmethodID alertDialog_builder_setMessage_method = env->GetMethodID("setMessage", "(Ljava/lang/CharSequence;)Landroid/app/AlertDialog/Builder;");
  6.      jmethodID alertDialog_builder_setPositiveButton_method =
  7.                env->GetMethodID("setPositiveButton",
  8.                                 "(Ljava/lang/CharSequence;Landroid/content/DialogInterface/OnClickListener;)"
  9.                                 "Landroid/app/AlertDialog/Builder");
  10.  
  11.      jmethodID alertDialog_builder_show_method = env->GetMethodID("show", "()Landroid/app/AlertDialog;");
  12.  
  13.      // AlertDialog.Builder builder = new AlertDialog.Builder(appContext);
  14.      jobject builder = env->NewObject(alertDialog_builder_class, alertDialog_builder_ctor_method, pInstance->appContext);
  15.  
  16.      // String title = new String("Warning");
  17.      // builder.setTitle(title);
  18.      jstring title = env->NewStringUTF("Warning:");
  19.      env->CallObjectMethod(alertDialog_buider_class, alertDialog_builder_setTitle_method, title);
  20.  
  21.      // builder.setMessage("This is an illegal copy.");
  22.      env->CallObjectMethod(alertDialog_builder_class, alertDialog_builder_setMessage_method,
  23.                            env->NewStringUTF("This is an illegal copy.");
  24.  
  25.      // builder.setPositionButton("OK", null);
  26.      env->CallObjectMethod(alertDialog_builder_class, alertDialog_builder_setPositiveButton_method,
  27.                           env->NewStringUTF("OK"), 0);
  28.  
  29.      // builder.show()
  30.      env->CallObjectMethod(alertDialog_builder_class, alertDialog_builder_show_method);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand