// This callback happens from the java thread, after a string has been // pulled off the message queue void AppLocal::TtjCommand( JNIEnv & jni, const char * commandString ) { if ( MatchesHead( "toast ", commandString ) ) { jstring cmdString = (jstring) ovr_NewStringUTF( &jni, commandString + 6 ); jni.CallVoidMethod( Java.ActivityObject, createVrToastMethodId, cmdString ); jni.DeleteLocalRef( cmdString ); return; } if ( MatchesHead( "finish ", commandString ) ) { jni.CallVoidMethod( Java.ActivityObject, finishActivityMethodId ); } }
// This callback happens from the java thread, after a string has been // pulled off the message queue void AppLocal::TtjCommand( JNIEnv & jni, const char * commandString ) { if ( MatchesHead( "finish ", commandString ) ) { jni.CallVoidMethod( Java.ActivityObject, finishActivityMethodId ); } }
/* * Command * * Actions that need to be performed on the render thread. */ bool MoviePlayerView::Command( const char * msg ) { if ( CurViewState != VIEWSTATE_OPEN ) { return false; } if ( MatchesHead( "resume ", msg ) ) { Cinema.MovieSelection( false ); return false; // allow VrLib to handle it, too } else if ( MatchesHead( "pause ", msg ) ) { Native::StopMovie( Cinema.app ); return false; // allow VrLib to handle it, too } return false; }