Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display number of images from json using listview inside layout adapter and also programmatically to create imageview layouts in android?
    primarykey
    data
    text
    <p>Here I am using for loop to get the imagelayout inside relative layout it,depends upon the images from server. Sometimes 2 images or 3 images from server. </p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { HashMap&lt;String,String&gt; map=new HashMap&lt;String, String&gt;(); static String host = "http://197.0.0.1/"; static String imgurl=host+"site_media/"; map=hashmap.get(position); InputStream is=null; InputStream is1=null; Drawable d,d1; String photo1=(map.get(TAG_O)); int positi=map.get(TAG_O).length(); // Log.i("pos",String.valueOf(positi)); LinearLayout parentLayout = (LinearLayout)convertView.findViewById(R.id.linear); for (int i = 0; i &lt;3; i++) { // Log.i("image",photo1); imageView = new ImageView(getApplicationContext()); // imageView.setImageResource(R.drawable.bluecap_32); imageView.setAdjustViewBounds(true); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(40,40); imageView.setLayoutParams(params); try { is1 = (InputStream) new URL(imgurl+photo1).getContent(); Log.i("photo",photo1); }catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } d1 = Drawable.createFromStream(is1, "src name"); imageView.setImageDrawable(d1); parentLayout.addView(imageView, i); } } </code></pre> <p>Here I am getting many images from particular array list using json. So I want to display the images using imageview layout programmatically with horizontal scrollview and linear layout. But here image are not display in the listview. </p>
    singulars
    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