Skip to content Skip to sidebar Skip to footer

Can I Start A New Activity That's Not Specified In The Androidmanifst.xml File

I'm trying to do some dynamic code and I load a new class that's supposed to be an Activity and I want to start it, but using the regular startActivity(Intent) wants the Activity t

Solution 1:

You can't start an Activity that is not declared in your Manifest because Activities are started via the startActivity function and this will not work for Activities not declared in the manifest.

But you could try to declare an Activity in the manifest that takes a class name as data with the intent and in the oncreate creates an instance of the activity and then delegates all the calls to activity methods to the object that was created dynamically. (Warning never have done that just a spontaneous idea)

Post a Comment for "Can I Start A New Activity That's Not Specified In The Androidmanifst.xml File"