sách gpt4 ăn đã đi

c# - Xamarin.Essentials "The current Activity can not be detected. Ensure that you have called Init in your Activity or Application class."

In lại 作者:太空狗 更新时间:2023-10-29 22:15:30 24 4
mua khóa gpt4 giày nike

我的应用程序出现错误:

The current Activity can not be detected. Ensure that you have called Init in your Activity or Application class.

我使用模拟器 Genymotion。启用 GPS

public async Task btnAdd_Click()
{
thử
{
var request = new GeolocationRequest(GeolocationAccuracy.Medium);
var location = await Geolocation.GetLocationAsync(request);

if (location != null)
{
string note = "GPS: Latitude-" + location.Latitude + " Longitude-" + location.Longitude;
}
}
catch (Exception ex)
{
// Unable to get location
}
}

câu trả lời hay nhất

与错误状态一样,您是否添加了这一行:

Xamarin.Essentials.Platform.Init(this, bundle);

hiện hữu MainActivity.cs của OnCreate 方法中?

关于c# - Xamarin.Essentials "The current Activity can not be detected. Ensure that you have called Init in your Activity or Application class.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51800427/

24 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress