Error ActivityNotFoundException on Android 3.X

Orlando

Member
Licensed User
Longtime User
Hi, i've a problem with this code:

Code: Copy
Sub btnAdminApps_Click
    Dim intent1 As Intent
    intent1.Initialize("android.intent.action.MAIN","")
    intent1.SetComponent("com.android.setting/.APPLICATION_SETTINGS")
    StartActivity(intent1)
End Sub
On my phone with Android 2.3 works great but on my tablet with Android 3.2 does not work, I get the follow message:



android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.setting/com.android.setting.APPLICATION_SETTINGS}; have you declared this activity in your AndroidManifest.xml?



how can i fix it?

thanks

Orlando
 
Change this line from:
Code: Copy
intent1.SetComponent("com.android.setting/.APPLICATION_SETTINGS")
to:
Code: Copy
intent1.SetComponent("com.android.setting/.ApplicationSettings")

However, that activity might not exist on other devices.
 
Last edited:
Upvote 0
I've tried this code and it works, why?

Code: Copy
Dim DoAction As Intent
    DoAction.Initialize("android.settings.APPLICATION_SETTINGS", "")
    StartActivity(DoAction)
 
Last edited:
Upvote 0
Back
Top