title: Images are not show in ListView Item on Camera click in Android
body: <p>Currently , i added HorizontalScrollView In each item of List View each HorizontalScrollView displayes the images dynamically on the basis of data fetched from the sqlite. Sqlite is preloaded with the data that is downloaded from our application server. </p>
  
  <p>Also, In each list item 'Camera' button is added. On click event of this button I am adding images captured from Camera to the existing HorizontalScrollView. </p>
  
  <p>1) First I'm trying to show images dynamically in HorizontalScrollView from sqlite in ArrayAdapter -</p>
  
  <pre><code> @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View row = convertView;
          final Holder holder;
          if (row == null) {
              LayoutInflater vi;
              vi = LayoutInflater.from(getContext());
              row = vi.inflate(R.layout.all_post_row, null);
              holder = new Holder(); 
              holder.imgBtn_Camera = (ImageView) row.findViewById(R.id.imgButton_Camera);
              holder.imgBtn_Audio = (ImageView) row.findViewById(R.id.imgButton_RecordAudio);
              holder.horizontalScrollView = (HorizontalScrollView) row.findViewById(R.id.hlist);
              holder.lLinearLayout = (LinearLayout) row.findViewById(R.id.innerlay);
              row.setTag(holder);
          } else {
              holder = (Holder) row.getTag();}
  
      strListItem_ActivityId = all_Post.getStrActivityId();
      dbhelper = new MyDbHelper(AllPosts_Page.this);
      SQLiteDatabase db = dbhelper.getReadableDatabase();
      Cursor cursor = db.rawQuery("select * from ActivityObjectList where activityId " + "= ? ", new String[]{strListItem_ActivityId});
      imageArray.clear();
      if (cursor.moveToFirst()) {
          do {
              String imagePath = cursor.getString(cursor.getColumnIndex("imageaudioPath"));
              Log.e("imagePath ", " = " + imagePath);
              imageArray.add(imagePath);
          }
          while (cursor.moveToNext());
      }
      cursor.close();
      db.close();
  
      holder.lLinearLayout.removeAllViews();
  
      final Iterator&lt;String&gt; it = imageArray.iterator();
      while (it.hasNext()) {
          LayoutInflater mInflater;
          mInflater = LayoutInflater.from(getContext());
          View cur_deal = mInflater.inflate(R.layout.horizontalitem,      holder.lLinearLayout, false);
  
          imageView = (ImageView) cur_deal.findViewById(R.id.image_AllPost);
          pBar = (ProgressBar) cur_deal.findViewById(R.id.pBar_AllPost);
          pBar.setVisibility(View.VISIBLE);
          holder.lLinearLayout.addView(cur_deal);
  
          final String imgElement = it.next();
          String baseDir =  Environment.getExternalStorageDirectory().getAbsolutePath();
         String path = baseDir + "/classnkk_images/" + imgElement;
         Log.e("path ", " = " + path);
  
      File photos = new File(path);
      final Bitmap bitmapResizeImage = decodeFile(photos);
      imageView.setImageBitmap(bitmapResizeImage);
      }
  </code></pre>
  
  <p>2) Here is my Camera button click event in ArrayAdapter class -</p>
  
  <pre><code>holder.imgBtn_Camera.setOnClickListener(new View.OnClickListener()
  {
      @Override
      public void onClick(View v)
      {
          Toast.makeText(context, "Camera" + " = ", Toast.LENGTH_SHORT).show();
          Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          ((Activity) context).startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
      }
  });
  </code></pre>
  
  <p>3) Here is onActivityResult method implementation  which is in Activity class -</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, data);
  
     if (requestCode == CAMERA_PIC_REQUEST &amp;&amp; resultCode == Activity.RESULT_OK)
      {
         {
              onActivityResult(requestCode, resultCode, data);
              Bitmap bp = (Bitmap) data.getExtras().get("data");
              imageView.setImageBitmap(bp);
          }
       }
    }
  </code></pre>
  
  <p>The above code should show the images captured from camera into HorizontalScrollView. . I am not able to understand where does it went wrong ? I have tried to modify code in many ways. However it did not help.</p>
  
  <p>I'm trying to solve this issue since 15 days.Please someone help me for this question.</p>
  
  <p>Thanks in advanced.</p>