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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -