I'm an android beginner, and I'm trying to find a way to retrieve data from a mysql database into a ListView, but in a Fragment instead of in an Activity. Is that even possible? Can someone give me some advises??
Asked
Active
Viewed 3,807 times
2 Answers
0
Yes it is possible. you can create a ListView in the frgamentLayout and use that listview in the fragment by using findViewById.
Then you can create a function which returns all the data from the mysql as a List and you can set that list data to the LsiyView by using an adapter.
I have already tried it once and it worked fine.

RajSharma
- 1,941
- 3
- 21
- 34
-
good to know that it's possible! Can you please show me how can I do it? – gaiaayan Feb 05 '15 at 21:00
0
After a looooong search, finally I've found a solution
http://codeoncloud.blogspot.com.es/2013/07/android-mysql-php-json-tutorial.html
I used this code in my fragment, and it worked!!!!

gaiaayan
- 23
- 2
- 6