Crishnan Crishnan - 3 months ago 23
Android Question

ACTION_LOCATION_SOURCE_SETTINGS : cannot be resolved or is not a field

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);

Answer

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);
Comments