mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 00:51:32 -08:00
Call a callback when android permissions are granted
This commit is contained in:
1 parent
e99b400e26
commit
5cd2c695e9
4 files changed
+68
-2
No files matched your search
@@ -0,0 +1,46 @@
|
||||
package org.meumeu.wivrn;
|
||||
|
||||
public class MainActivity extends android.app.NativeActivity
|
||||
{
|
||||
public static native void sendMessageFromJava(String msg, String arg);
|
||||
|
||||
static
|
||||
{
|
||||
System.loadLibrary("wivrn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public native void onRequestPermissionsResult(int requestCode, String [] permissions, int[] grantResults);
|
||||
|
||||
// @Override
|
||||
// public void onRequestPermissionsResult(int requestCode, String [] permissions, int[] grantResults)
|
||||
// {
|
||||
// super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
// // switch (requestCode) {
|
||||
// // case REQUEST_CODE_STORAGE_PERMISSION:
|
||||
// // if (permissionsGranted(permissions, grantResults)) {
|
||||
// // NativeApp.sendMessageFromJava("permission_granted", "storage");
|
||||
// // } else {
|
||||
// // NativeApp.sendMessageFromJava("permission_denied", "storage");
|
||||
// // }
|
||||
// // break;
|
||||
// // case REQUEST_CODE_LOCATION_PERMISSION:
|
||||
// // if (permissionsGranted(permissions, grantResults)) {
|
||||
// // mLocationHelper.startLocationUpdates();
|
||||
// // }
|
||||
// // break;
|
||||
// // case REQUEST_CODE_CAMERA_PERMISSION:
|
||||
// // if (mCameraHelper != null && permissionsGranted(permissions, grantResults)) {
|
||||
// // mCameraHelper.startCamera();
|
||||
// // }
|
||||
// // break;
|
||||
// // case REQUEST_CODE_MICROPHONE_PERMISSION:
|
||||
// // if (permissionsGranted(permissions, grantResults)) {
|
||||
// // NativeApp.audioRecording_Start();
|
||||
// // }
|
||||
// // break;
|
||||
// // default:
|
||||
// // }
|
||||
//
|
||||
// }
|
||||
}
|
||||
Reference in new issue
Block a user