Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 292
Joel Avatar asked Jun 11 '11 01:06

Joel


2 Answers

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

like image 86
ferostar Avatar answered Sep 23 '22 03:09

ferostar


You can't create activity at run time so what you can u is create Layouts at the run time and change the layout according to the event...

here you are going to use layout change instead of starting a new activity

like image 23
Jaber Shabeek Avatar answered Sep 25 '22 03:09

Jaber Shabeek