INNER CODE UNIT · C
textUTF
Qfusion/qfusion · source/android/android_clipboard.c:40
textUTF = ( *env )->GetStringUTFChars( env, textJS, NULL );
text = Q_malloc( strlen( textUTF ) + 1 );
strcpy( text, textUTF );
( *env )->ReleaseStringUTFChars( env, textJS, textUTF );
( *env )->DeleteLocalRef( env, textJS );
return text;
}
bool Sys_SetClipboardData( const char *data ) {
JNIEnv *env = Sys_Android_GetJNIEnv();
jmethodID setClipboardData;
jstring textJS;
setClipboardData = ( *env )->GetMethodID( env, sys_android_activityClass, "setClipboardData", "(Ljava/lang/CharSequence;)V" );
textJS = ( *env )->NewStringUTF( env, data );
( *env )->CallVoidMethod( env, sys_android_app->activity->clazz, setClipboardData, textJS );
( *env )->DeleteLocalRef( env, textJS );