struct android_menu_subprefix *subprefix_1;
bool checkmark;
unsigned int serial;
+ JNIEnv *env;
count = SPECPDL_INDEX ();
serial = ++current_menu_serial;
+ env = android_java_env;
block_input ();
context menu. */
store = current_context_menu;
current_context_menu
- = (*android_java_env)->CallObjectMethod (android_java_env,
- current_context_menu,
- menu_class.parent);
+ = (*env)->CallNonvirtualObjectMethod (env,
+ current_context_menu,
+ menu_class.class,
+ menu_class.parent);
android_exception_check ();
if (store != context_menu)
store = current_context_menu;
current_context_menu
- = (*android_java_env)->CallObjectMethod (android_java_env,
- current_context_menu,
- menu_class.add_submenu,
- title_string,
- help_string);
+ = (*env)->CallNonvirtualObjectMethod (env,
+ current_context_menu,
+ menu_class.class,
+ menu_class.add_submenu,
+ title_string,
+ help_string);
android_exception_check ();
if (store != context_menu)
checkmark = (EQ (type, QCtoggle)
|| EQ (type, QCradio));
- (*android_java_env)->CallVoidMethod (android_java_env,
- current_context_menu,
- menu_class.add_item,
- (jint) item_id,
- title_string,
- (jboolean) !NILP (enable),
- (jboolean) checkmark,
- (jboolean) !NILP (selected),
- help_string,
- (jboolean) (EQ (type,
- QCradio)));
+ (*env)->CallNonvirtualVoidMethod (env,
+ current_context_menu,
+ menu_class.class,
+ menu_class.add_item,
+ (jint) item_id,
+ title_string,
+ (jboolean) !NILP (enable),
+ (jboolean) checkmark,
+ (jboolean) !NILP (selected),
+ help_string,
+ (jboolean) (EQ (type,
+ QCradio)));
android_exception_check ();
if (title_string)
/* Now, display the context menu. */
window = android_resolve_handle (FRAME_ANDROID_WINDOW (f),
ANDROID_HANDLE_WINDOW);
- rc = (*android_java_env)->CallBooleanMethod (android_java_env,
- context_menu,
- menu_class.display,
- window, (jint) x,
- (jint) y,
- (jint) serial);
+ rc = (*env)->CallNonvirtualBooleanMethod (env, context_menu,
+ menu_class.class,
+ menu_class.display,
+ window, (jint) x,
+ (jint) y,
+ (jint) serial);
android_exception_check ();
if (!rc)
int id;
jmethodID method;
unsigned int serial;
+ JNIEnv *env;
/* Generate a unique ID for events from this dialog box. */
serial = ++current_menu_serial;
ANDROID_DELETE_LOCAL_REF (java_header);
ANDROID_DELETE_LOCAL_REF (java_title);
+ /* Save the JNI environment pointer prior to constructing the
+ dialog, as typing (*android_java_env)->... gives rise to very
+ long lines. */
+ env = android_java_env;
+
/* Create the buttons. */
i = MENU_ITEMS_PANE_LENGTH;
while (i < menu_items_used)
/* Add the button. */
temp = android_build_string (item_name);
- (*android_java_env)->CallVoidMethod (android_java_env,
- dialog,
- dialog_class.add_button,
- temp, (jint) i,
- (jboolean) NILP (enable));
+ (*env)->CallNonvirtualVoidMethod (env, dialog,
+ dialog_class.class,
+ dialog_class.add_button,
+ temp, (jint) i,
+ (jboolean) NILP (enable));
android_exception_check ();
ANDROID_DELETE_LOCAL_REF (temp);
i += MENU_ITEMS_ITEM_LENGTH;
}
/* The dialog is now built. Run it. */
- rc = (*android_java_env)->CallBooleanMethod (android_java_env,
- dialog,
- dialog_class.display);
+ rc = (*env)->CallNonvirtualBooleanMethod (env, dialog,
+ dialog_class.class,
+ dialog_class.display);
android_exception_check ();
if (!rc)