相关疑难解决方法(0)

如何显示Google地图等启用位置对话框?

我使用最新版本的Google Play服务(7.0)并按照其指南中给出的步骤操作,并启用了如下所示的位置对话框,其中包含"从不"按钮.我的应用程序强制要求位置,所以我不想向用户显示永远不会,因为一旦用户点击"从不",我就无法再获取位置或请求位置.

谷歌地图只有是和没有按钮没有从不按钮,任何想法如何实现相同?

我的应用程序的图像 在此输入图像描述

谷歌地图的形象 在此输入图像描述

android google-play-services

124
推荐指数
7
解决办法
8万
查看次数

LocationSettingsRequest对话框启用GPS - 跳过onActivityResult()

我的应用程序的一部分需要位置服务,因此如果当前关闭位置,应用程序将提示用户启用它.下面是我正在做它:(也见于这个堆栈溢出的答案)

LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
            .addLocationRequest(mLocationRequest);
builder.setAlwaysShow(true);

PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());

result.setResultCallback(new ResultCallback<LocationSettingsResult>() 
{
     @Override
     public void onResult(LocationSettingsResult result) 
     {
         final Status status = result.getStatus();
         final LocationSettingsStates = result.getLocationSettingsStates();
         switch (status.getStatusCode()) 
         {
             case LocationSettingsStatusCodes.SUCCESS:
                 // All location settings are satisfied. The client can initialize location
                 // requests here.
                 ...
                 Log.d("onResult", "SUCCESS");
                 break;
             case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
                 // Location settings are not satisfied. But could be fixed by showing the user
                 // a dialog.
                 Log.d("onResult", "RESOLUTION_REQUIRED");
                 try …
Run Code Online (Sandbox Code Playgroud)

android dialog

51
推荐指数
4
解决办法
4万
查看次数

以编程方式启用GPS(无需导航到位置设置)

如何通过点击弹出屏幕上的"开启"选项(无需导航到位置设置),以编程方式启用GPS,因为它确实发生在官方Google地图应用中?

android location-services

16
推荐指数
2
解决办法
2万
查看次数

在Android中以编程方式启用位置提供程序

是否可以以编程方式打开设备上的LocationProviders(GPS提供商/网络提供商),如果它已关闭?

android location-provider

7
推荐指数
2
解决办法
2万
查看次数

颤振-如何打开或要求用户打开位置?

嗨,正如我在标题中所写,我该如何实现?我已获得位置信息许可,但无法打开位置信息!

android dart flutter

5
推荐指数
3
解决办法
3485
查看次数

在不导航到设置页面的情况下打开位置服务?飞镖

我们正在迁移到 Flutter。我们使用此线程打开位置服务而无需导航到设置页面

如何在 Flutter 中实现这一点?

导航到设置的当前临时代码:

  Future _getCurrentLocation() async {
    Position position;
    try {
      position = await Geolocator().getCurrentPosition(
          desiredAccuracy: LocationAccuracy.bestForNavigation);
    } on PlatformException catch(e){
      print(e.code);
      if(e.code =='PERMISSION_DISABLED'){
        print('Opening settings');
        await openLocationSetting();
        try {
          position = await Geolocator().getCurrentPosition(
              desiredAccuracy: LocationAccuracy.bestForNavigation);
        } on PlatformException catch(e){
          print(e.code);
        }
      }
    }

    setState(() {
//      _center = LatLng(currentLocation['latitude'], currentLocation['longitude']);
      _center = LatLng(position.latitude, position.longitude);
    });
  }
  Future openLocationSetting() async {
    final AndroidIntent intent = new AndroidIntent(
      action: 'android.settings.LOCATION_SOURCE_SETTINGS',
    );
    await intent.launch();

  }
Run Code Online (Sandbox Code Playgroud)

location geolocation dart flutter

5
推荐指数
1
解决办法
1465
查看次数

是否已激活GPS - 颤动

如果GPS被激活或停用,有没有办法找到Flutter?我使用插件位置但是我只获得位置而不是GPS的状态.

dart flutter

4
推荐指数
3
解决办法
3773
查看次数

Waze之类的某些应用程序如何以编程方式打开GPS?

我搜索了很多有关以编程方式打开GPS的信息,但没有找到任何解决方案。但是有些像Waze这样的应用程序不是系统应用程序,可以打开GPS!

例如,在显示该窗口的Waze中(如果GPS关闭!):

在此处输入图片说明

然后单击“打开GPS”将显示以下内容:

在此处输入图片说明

GPS将会自动开启!我们怎样才能像位智一样做到这一点?

android android-gps

2
推荐指数
1
解决办法
648
查看次数