0

All. I develop my Daydream app in Android Studio.

I need to get permission(READ & WRITE). so I used permission request dialog.

but Daydream didn't recommend my way so I want to below flowchart.

Current My Code

Start app -> Permission Check(2D Activity onCreate) -> Permission Popup

-> VR Main start(VR onCreate)

I want to this flowchart

Start app -> VR Main start(VR onCreate) -> Permission Check

-> move 2D Activity & Permission Popup(2D oncreate) -> VR Main (VR onResume)

Please refer this FlowChart Image

I found this method(exitFromVr). but I don't know how am i write code. If you have example code, Please let me know.

My English is not good so I need to your kind help. Thank you.

iehrlich
  • 3,572
  • 4
  • 34
  • 43

1 Answers1

0

The basic idea is to launch another Activity that will request the permission for you, then return to the main VR activity.

So from your main activity (in VR), show your transition dialog and call exitFromVr(myPermissionActivity, MY_REQUEST_CODE, MyData).

Removing your phone from the headset will cause the OS to trigger an intent for 'myPermissionActivity' (this activity should be setup with the needed permissions).

Then exit the permission activity, which will fallback to the main VR activity. In code I have seen the permission was activity setup with a close button, which just exits the activity.

  • thanks for your answer. but I don't know how am i write the parameters in exitFromVr. if do you have sample code, Please let me know. I don't know what is means 'MyData(Intent)' – DaeHwan Kim Jul 14 '17 at 01:52