回答編集履歴
1
追記
answer
CHANGED
@@ -1,3 +1,25 @@
|
|
1
1
|
参考にされた記事は古いので、公式のセットアップ方法を確認して試してみてください。
|
2
2
|
|
3
|
-
[https://jamesmontemagno.github.io/GeolocatorPlugin/GettingStarted.html](https://jamesmontemagno.github.io/GeolocatorPlugin/GettingStarted.html)
|
3
|
+
[https://jamesmontemagno.github.io/GeolocatorPlugin/GettingStarted.html](https://jamesmontemagno.github.io/GeolocatorPlugin/GettingStarted.html)
|
4
|
+
|
5
|
+
現バージョンでは、`MainActivity`を以下のようにします。
|
6
|
+
```C#
|
7
|
+
protected override void OnCreate(Bundle bundle)
|
8
|
+
{
|
9
|
+
TabLayoutResource = Resource.Layout.Tabbar;
|
10
|
+
ToolbarResource = Resource.Layout.Toolbar;
|
11
|
+
|
12
|
+
base.OnCreate(bundle);
|
13
|
+
|
14
|
+
CrossCurrentActivity.Current.Init(this, bundle); //追加
|
15
|
+
|
16
|
+
...
|
17
|
+
}
|
18
|
+
|
19
|
+
//追加
|
20
|
+
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
|
21
|
+
{
|
22
|
+
Plugin.Permissions.PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
23
|
+
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
24
|
+
}
|
25
|
+
```
|