• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Why my custom ListView is not showing anithing?

 
Greenhorn
Posts: 4
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm taking news from newsapi as a JSON object. I'm storing them in a string array to display it on a list! I can retrieve data successfully but my ListView is not getting populated?


After running this code all I can see is an blank fragment!

Note:
-AsyncHTTPTask class extends AsyncTask to retrieve data in background from api and store it in the String arrays with the help of two methods streamToString() and parseResult()!
-NewsAdapter is my class for creating custom adapter!

Any help will be appreciated!
 
Ranch Foreman
Posts: 376
4
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are always passing empty value to adapter class,thats why your fragment is always empty,
I would suggest you to create a POJO class, and set those value(where you get from parseResult) to it.

Model

Use an object arrayList to store the Model object instance.

Replace the initialization of your adapter class to this

Finally modify your adapter class to this


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!