Android Intent and Intent filter -
i have problem here code. want pass activity button. here 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 cannot find problem. seem right me.
there no action name android.intent.action.settings. try remove <intent-filter> manifest , add code snippet in onclick() method:
intent intent = new intent(android.provider.settings.action_settings); intent.addflags(intent.flag_activity_new_task); context.startactivity(intent); take @ question opening android settings programmatically
Comments
Post a Comment