0
please see the below code 
      //here i call the gallery view
        Gallery g = (Gallery) findViewById(R.id.gallery);
            g.setAdapter(new ImageAdapter(this, json));

        //image adapter class
      public class ImageAdapter extends BaseAdapter {
    Bitmap bmp;
          private ImageView[] mImages;
          String[] itemimage;

       public ImageAdapter(Context context, JSONArray imageArrayJson) {
        this.mImages = new ImageView[imageArrayJson.length()];
        String qrimage;
         try
       {
        private Image View[] mImages; 
       for (int i = 0; i < imageArrayJson.length(); i++) {
        JSONObject image = imageArrayJson.getJSONObject(i);
        qrimage = image.getString("itemimage");


        byte[] qrimageBytes = Base64.decode(qrimage.getBytes());

        bmp = BitmapFactory.decodeByteArray(qrimageBytes,
                                            0,
                                            qrimageBytes.length);
        mImages[i] = new ImageView(context);

        mImages[i].setImageBitmap(bmp);  

       my xml view
       <Gallery xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
 />

i can view the images through url using json i can get in gallery layout . i want get the same data into listview.please help me

I am getting all the json data using url to the android i pass the image adapter class here here gallery view can appears using gallery .. i want vew the images instead of gallery to listveiw

1 Answers1

0

You need to write an own adapter. And you have to supply an own layout for the listview items

Maybe this discussion give an impression

Custom ListView adapter, strange ImageView behavior

Or this tutorial

http://www.vogella.de/articles/AndroidListView/article.html

Community
  • 1
  • 1
stefan bachert
  • 9,413
  • 4
  • 33
  • 40