Vrashabh Irde
Vrashabh Irde

Reputation: 14377

Populating a list view from another list view

I need to achieve this: I have a sqlite table with this data

slno Type   Level_1 Level_2      Level_3
1 Animals   Cat     Null         /sdcard/Video
2 Animals   Cat     Null         /sdcard/PDF
3 Birds    Aves     HummingBird  /sdcard/video

I should have a list view with Animals and Birds , clicking on Animals shows me Cat, while Bird shows me Aves. Then so on until the content - which has to be played depending on the type. Now this can be achieved by creating a lot of Activities say for Animals level - pass level_1 for Activity_2 and so on and get the list views. But in my case the levels may not be fixed - there might be a level_4 coming in where there is content - so the activity creation has to be dynamic and cannot be static - how can this be achieved ?

Upvotes: 0

Views: 504

Answers (3)

Vrashabh Irde
Vrashabh Irde

Reputation: 14377

Implemented by modifying the base adapter to include multiple levels.

Upvotes: 0

Tofeeq Ahmad
Tofeeq Ahmad

Reputation: 11975

No need to create lots of activity.If understand your problem completely then i will suggest you go for Expandable List View like in image enter image description here

This link has best tutorial for this design Go through it

Upvotes: 1

jeet
jeet

Reputation: 29199

Just Use only One activity, and Set this Activity's Data Source on calling activity, like

intent.putExtra("KEY", DataSource);

in onCreate() method get this DataSource from intent, like

intent.getParcelableList("KEY");

and start this activity only with new data source, or play the file according to the level.

Upvotes: 0

Related Questions