Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay and parse images from DB to listview
    primarykey
    data
    text
    <p>I have to display data from mysql database in the listview of my android app. I have successfully parsed the textual data and displayed it in custom listview but the image are not being parsed and displayed in the list. I have tried using imageloader, file cache, memory cache, but still have not succeeded.</p> <p>If anyone have any idea about what is missing or what should be added to it, any help would be appreciated. </p> <pre><code>public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub TextView tourname; TextView duration; ImageView flag; inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View itemView = inflater.inflate(R.layout.list_row1, parent, false); // Get the position from the results // Locate the TextViews in listview_item.xml tourname = (TextView) itemView.findViewById(R.id.themeTourList_title); duration = (TextView) itemView.findViewById(R.id.themeTourList_price); // Locate the ImageView in listview_item.xml flag = (ImageView) itemView.findViewById(R.id.themeTourList_image); // Capture position and set results to the TextViews try { tourname.setText(mJSONArray.getJSONObject(position).getString("tour_name")); duration.setText(""+mJSONArray.getJSONObject(position).getString("nights")+" Nights - "+mJSONArray.getJSONObject(position).getString("days")+" Days"); try{ URL url = new URL("www.futurolicht.com/"+mJSONArray.getJSONObject(position).getString("pic")); Bitmap bitmap = BitmapFactory.decodeStream((InputStream)(url).getContent()); flag.setImageBitmap(bitmap); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload