app/internal/window: [Android] replace RegisterFragment with Do

Do is a function for accessing the underlying Android View in a safe
context, the main thread. Do is

- more general than RegisterFragment and may be expanded to other platforms
- simpler to implement (from the Gio side)

and as a bonus, the Do implementation avoids a race condition where
a call to RegisterFragment during an Activity re-create would be ignored.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-13 16:09:33 +02:00
parent f36674ddb3
commit 8688ed95c2
4 changed files with 60 additions and 57 deletions
+9 -5
View File
@@ -37,10 +37,14 @@ program's source code:
Android -- Dangerous Permissions
Certain permissions on Android are marked with a protection level of
"dangerous". This means that, in addition to including the relevant Gio
permission packages, your app will need to prompt the user specifically
to request access. This can be done with a java Fragment, installed using
(*app.Window).RegisterFragment(). For more information on dangerous
permissions, see: https://developer.android.com/guide/topics/permissions/overview#dangerous_permissions
"dangerous". This means that, in addition to including the relevant
Gio permission packages, your app will need to prompt the user
specifically to request access. To access the Android Activity
required for prompting, use the Do method on Window. Do exposes
the underlying Android View, on which the getContext method returns
the Activity.
For more information on dangerous permissions, see:
https://developer.android.com/guide/topics/permissions/overview#dangerous_permissions
*/
package permission