Reputation: 14314
In my application I want a panel that contains some text information then below it a list of menu items. What is the best way to do this?
Is it possible to have a ListView within the fragment along with other TextView's etc.
If not is it possible to have a ListFragment within a Fragment? That is what I am attempting at the moment but when I try and run it I get an error:
java.lang.IllegalStateException: Fragment LeftMenuFragment{4089c090} not attached to Activity
Upvotes: 1
Views: 758
Reputation: 18499
Yes you can have listview in a fragment. Like ListActivty there is Listfragment which you can use for using ListView in your application.
See this market tutorial for help
Upvotes: 1
Reputation: 24235
The answer is 'Yes' we can have a listview in fragment. The error is self explanatory. You hav not added it to the activity or any layout.
Upvotes: 0