Search code examples
androidandroid-activity

Dynamically create an activity


I want to create an activity dynamically. Something like:

Activity a = new Activity();

Is it possible ? Do I need a special permission ? Or is it simply not possible ?

The error I get: I don't get any exception but the program stops when I try to use this instruction.


Solution

  • You can't instantiate an Activity if it's not in the Manifest, so you can't create one dynamically.