Skip to content Skip to sidebar Skip to footer

Any Way To Check If An Activity In Android Is Registered In Manifest File?

Is there any way to check if an Activity in android is registered in manifest file before starting it? say eg: String test = 'com.Hy5.activity.Navigate'; Intent

Solution 1:

Use PackageManager.getActivityInfo() It will throw PackageManager.NameNotFoundException if it's not there

Not sure you will gain anything by doing this though.

Solution 2:

If you get ActivityNotFound Exception, that usually means it is not registered in manifest. You could do something with that.

Post a Comment for "Any Way To Check If An Activity In Android Is Registered In Manifest File?"