Search code examples
android-activity

Create new activity in application


Is it possible to create a new activity in the application (not in Android Studio)?

For example, I have a listview to which I can add new items. What I want is when I click on one of the items, then it will start/create a new activity that are dedicated to that specific item. Is it possible? Or is there another way to do it?


Solution

  • No,You wont be able to create activity run time and its not a good design creating dedicated activity for each list item.

    Instead you could have single list item detail or list item info screen activity(Whatever you call) and populate the data based on the selected item. If you have different UI elements for each list item, you might need to have multiple fragments instead.