Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:44:42+00:00 2026-06-15T02:44:42+00:00

I have built a custom camera app that saves pictures to a specific folder

  • 0

I have built a custom camera app that saves pictures to a specific folder on my sdcard and has its own gallery view for viewing the photos in that folder “/sdcard/myApp/images”

I have been testing it on two different tablets, Galaxy Tab-1 10 inch and Galaxy Tab-2 10 inch. The camera works on both tablets just fine, taking pictures and saving them to the app created folder. But the gallery View on the Tab1, doesn’t show all the photos in that folder. The tab-2 always shows all the photos currently in the folder but the tab-1 often only shows the images in that folder from the last time the tablet was rebooted.

So on the Tab-1 if i have no photos in that folder and then take two pictures with the camera and switch to the gallery view, it shows no photos. If i then reboot, and go to the gallery view i see both of the photos, but if i switch to the camera and take another photo the gallery only shows the original two until i reboot.

works on android 3.2 + but 3.1 nope!

Any ideas?

cursor sent to adapter in constructor of galleryView:

 // Set up an array of the Thumbnail Image ID column we want
    String[] projection = {MediaStore.Images.Media._ID};
    // Create the cursor pointing to the SDCard
    cursor = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
            projection, // Which columns to return
            MediaStore.Images.Media.DATA + " like ? ",
            new String[] {"%LC/images%"},  
            MediaStore.Images.Media._ID + " DESC");


    // Get the column index of the Thumbnails Image ID
    columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media._ID);


    ga.setAdapter(new GallAdapter(this,cursor,columnIndex));

addapter:

public class GallAdapter extends BaseAdapter {
    public Cursor cursor;
    private int columnIndex;
    private Context context;
    int imageBackground;
    String url;
    Uri uri;
    int originalImageId;
    int imageID;
    int columnData;
    ViewGroup myp;
    ImageView d;

    public GallAdapter(Context ctx, Cursor cur, int cIn ) {
        context = ctx;
        columnIndex = cIn;

        cursor = cur;
        Log.v("GallAdapter", "COUNT:"+getCount());
    }

    @Override
    public int getCount() {

        return cursor.getCount();
    }

    @Override
    public Object getItem(int position) {

        return position;
    }

    @Override
    public long getItemId(int position) {

        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        myp = parent;
        View v;
        if(convertView ==null){
            v = LayoutInflater.from(context).inflate(R.layout.galitem, parent, false);
        }else{
            v = convertView;
        }


        ImageView photo = (ImageView) v.findViewById(R.id.imageView);
        ImageView border = (ImageView) v.findViewById(R.id.borderView);
        d = (ImageView) v.findViewById(R.id.delView);



        // Move cursor to current position
        cursor.moveToPosition(position);

        // Get the current value for the requested column
        imageID = cursor.getInt(columnIndex);
        // obtain the image URI
        uri = Uri.withAppendedPath( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, Integer.toString(imageID) );
        url = uri.toString();
        // Set the content of the image based on the image URI
        originalImageId = Integer.parseInt(url.substring(url.lastIndexOf("/") + 1, url.length()));
        Bitmap b = MediaStore.Images.Thumbnails.getThumbnail(context.getContentResolver(),
                        originalImageId, MediaStore.Images.Thumbnails.MINI_KIND, null);
        photo.setImageBitmap(b);

        photo.setScaleType(ImageView.ScaleType.FIT_CENTER); 
        d.setTag(uri);
        d.setOnClickListener(new OnClickListener(){


            public void onClick(View v) {

                String path = getRealPathFromURI((Uri) v.getTag());
                alertBox("Warning!", "Are you sure you want to delete this photo?", path, v);


            }


        });

        return v;
    }

again this works on tab-2 (os 4.0) and tab-1 now that the firm ware was updated on the tab-1 and the os from 3.1 to 3.2 but why was it not working..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:44:44+00:00Added an answer on June 15, 2026 at 2:44 am

    Try this in order to refresh your media files.

    this._context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + Environment.getExternalStorageDirectory() + "/Hugg/" + name)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a custom control that has a small amount of JavaScript. The
I have built a custom Camera App and I am trying to change the
I have built a custom membership provider that I have used in a previous
I have built a custom administration panel into a Rails application that allows content
I have built the following custom control that I have built and I set
I have built a few custom applications that run on WSS 3 using the
I have just built a custom autocomplete component using jquery. My problem is that
I have a custom built web service that is built to simply add items
I have built a Custom Control Class that makes it much easier to build
I have built a custom Data Class that stores IP Address Details. Public Class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.