I have a problem here with my code. I want to pass from an activity to another from a button. Here is my code:
MainActivity.class
ImageView imgsettings;
inside onCreate()
imgsettings = (ImageView) findViewById(R.id.imgviewsettings);
imgsettings.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent("android.intent.action.SETTINGS"));
}
});
AndroidManifest
<activity
android:name=".AppSettings"
android:label="@string/title_activity_app_settings" >
<intent-filter>
<action android:name="android.intent.action.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
I really cannot find the problem. Everything seem right to me.
There is no action with the name
android.intent.action.SETTINGS
. Try to remove the<intent-filter>
from your manifest and add this code snippet in theonClick()
method:Take a look at this SO question Opening Android Settings programmatically