ACTION_LOCATION_SOURCE_SETTINGS : cannot be resolved or is not a field

不问归期 提交于 2019-12-23 03:45:15

问题


I'm calling ACTION_LOCATION_SOURCE_SETTINGS via Intent.its is showing cannot be resolved or is not a field caused while importing Project from outside. What should i do now ?

Intent viewIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                        startActivity(viewIntent);

回答1:


Try this..

I guess your import is wrong

Use

import android.provider.Settings;

Or try like below.

Intent viewIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(viewIntent);



回答2:


In Eclipse check properties of your project, select 'Android' and check target name is 'Android 6.0' or +



来源:https://stackoverflow.com/questions/22004989/action-location-source-settings-cannot-be-resolved-or-is-not-a-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!