|
4 | 4 | using Android.OS; |
5 | 5 | using Android.Runtime; |
6 | 6 | using Android.Webkit; |
| 7 | +using AndroidX.Activity.Result; |
| 8 | +using AndroidX.Activity.Result.Contract; |
7 | 9 | using AndroidX.AppCompat.App; |
8 | 10 | using AndroidX.Core.App; |
9 | 11 | using AndroidX.Core.Content; |
10 | 12 | using ComputerUtils.Android; |
11 | 13 | using ComputerUtils.Android.Logging; |
12 | 14 | using Google.Android.Material.Snackbar; |
| 15 | +using Java.Interop; |
13 | 16 | using QuestAppVersionSwitcher.Core; |
| 17 | +using System; |
14 | 18 |
|
15 | 19 | namespace QuestAppVersionSwitcher |
16 | 20 | { |
| 21 | + public class ActivityCallback : Java.Lang.Object, IActivityResultCallback |
| 22 | + { |
| 23 | + public IntPtr Handle => throw new NotImplementedException(); |
| 24 | + |
| 25 | + public int JniIdentityHashCode => throw new NotImplementedException(); |
| 26 | + |
| 27 | + public JniObjectReference PeerReference => throw new NotImplementedException(); |
| 28 | + |
| 29 | + public JniPeerMembers JniPeerMembers => throw new NotImplementedException(); |
| 30 | + |
| 31 | + public JniManagedPeerStates JniManagedPeerState => throw new NotImplementedException(); |
| 32 | + |
| 33 | + public void Dispose() |
| 34 | + { |
| 35 | + throw new NotImplementedException(); |
| 36 | + } |
| 37 | + |
| 38 | + public void Disposed() |
| 39 | + { |
| 40 | + throw new NotImplementedException(); |
| 41 | + } |
| 42 | + |
| 43 | + public void DisposeUnlessReferenced() |
| 44 | + { |
| 45 | + throw new NotImplementedException(); |
| 46 | + } |
| 47 | + |
| 48 | + public void Finalized() |
| 49 | + { |
| 50 | + throw new NotImplementedException(); |
| 51 | + } |
| 52 | + |
| 53 | + public void OnActivityResult(Java.Lang.Object result) |
| 54 | + { |
| 55 | + throw new NotImplementedException(); |
| 56 | + } |
| 57 | + |
| 58 | + public void SetJniIdentityHashCode(int value) |
| 59 | + { |
| 60 | + throw new NotImplementedException(); |
| 61 | + } |
| 62 | + |
| 63 | + public void SetJniManagedPeerState(JniManagedPeerStates value) |
| 64 | + { |
| 65 | + throw new NotImplementedException(); |
| 66 | + } |
| 67 | + |
| 68 | + public void SetPeerReference(JniObjectReference reference) |
| 69 | + { |
| 70 | + throw new NotImplementedException(); |
| 71 | + } |
| 72 | + |
| 73 | + public void UnregisterFromRuntime() |
| 74 | + { |
| 75 | + throw new NotImplementedException(); |
| 76 | + } |
| 77 | + } |
| 78 | + |
17 | 79 | [Activity(Theme = "@style/AppTheme", MainLauncher = true)] |
18 | 80 | public class MainActivity : AppCompatActivity |
19 | 81 | { |
20 | 82 | WebView webView; |
21 | 83 | protected override void OnCreate(Bundle savedInstanceState) |
22 | 84 | { |
23 | 85 | Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true); |
| 86 | + AndroidCore.launcher = RegisterForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityCallback()); |
24 | 87 | base.OnCreate(savedInstanceState); |
25 | 88 | Xamarin.Essentials.Platform.Init(this, savedInstanceState); |
26 | 89 | // Set our view from the "main" layout resource |
|
0 commit comments