Recently, I've been using this plugin for picking files from storage for one of my AR Project. The following plugin is using the Storage Access Framework (SAF) for picking and saving files.
When I'm trying to use this in AR Scene (After Plane Detection), it lost its track after selecting/canceling from File Picker Interface.
I tried to call this plugin from UI Thread, but same as before. I've tried this code for calling from UI Thread -
new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity").Call("runOnUiThread", new AndroidJavaRunnable(() =>
{
AJC.CallStatic("PickFiles", Context, new FPResultCallbackAndroid(callback, null, null), false, SelectedFilePath, allowedFileTypes, "");
}));
Then,
I mailed the author of this plugin, he told me to add new flags to his source code and rebuild. I tried rebuilding adding FLAG_ACTIVITY_SINGLE_TOP flag to intent, but same as before. (I've quite little experience in Native Android Development, so I just google a bit and tried this).
I'm not sure if there is any proper way or is it possible to use SAF without putting Unity Application in the Background. Is there any solution to this problem?