ACTION_LOCATION_SOURCE_SETTINGS:无法解析或不是字段

Cri*_*nan 1 android android-intent android-location

我通过Intent.its调用ACTION_LOCATION_SOURCE_SETTINGS显示无法解析或不是从外部导入Project时导致的字段.我现在应该怎么做 ?

Intent viewIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                        startActivity(viewIntent);
Run Code Online (Sandbox Code Playgroud)

Har*_*ran 6

试试这个..

我想你的导入是错误的

使用

import android.provider.Settings;
Run Code Online (Sandbox Code Playgroud)

或者尝试如下.

Intent viewIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(viewIntent);
Run Code Online (Sandbox Code Playgroud)