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 6022577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:52:39+00:00 2026-05-23T03:52:39+00:00

i am very new to android and i am stuck here. i have a

  • 0

i am very new to android and i am stuck here. i have a gridview that is showing images from my sdcard, and a check box with each image for multiple selection. Now after selection, i want to send the images as to a servlet in a multipart http request. i think(correct me if i m wrong) that i need the image URIs to do that but i have no way of getting them after the menu item is selected. Here is the code

@Override
public boolean onOptionsItemSelected(MenuItem item)
{
    switch (item.getItemId())
    {
    case R.id.sendPics:
        // TODO - add code to get and send pics
        GridView grid = (GridView) findViewById(R.id.imageGrid);
        ImageAdapter imageAdapter = (ImageAdapter) (grid.getAdapter());

        for (int i = 0; i < grid.getChildCount(); i++)
        {
            Images im = (Images) imageAdapter.getItem(i);
            View view = grid.getChildAt(i);
            CheckBox cb = (CheckBox) view.findViewById(R.id.checkbox);
            // ImageView iv = (ImageView) view.findViewById(R.id.image);

            if (cb.isChecked())
            {
                Log.d(TAG, ">>>>>>>>>>checked check box found<<<<<<<<<<");

                // TODO get the image path hre to send as a multipart http request
            }
        }

        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

i get the image adapter to get the Loaded Image form this post android How to get image path from GridView through onItemClick listener but i cant find any LoadedImage class in my project so totally stuck. any help will be much appreciated.

edit:
Images im = (Images) imageAdapter.getItem(i);
in this line i cudnt find LoadedImage class so i thought to try with Images which is wrong.

  • 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-05-23T03:52:40+00:00Added an answer on May 23, 2026 at 3:52 am

    Use the following logic to get path of all images present in gallery. Create your own PhotoGrid to display all images. store the path of images in arraylist. show the the image in the gridview by taking from uri from the arraylist.

    The following arraylist contains path of all images in sd card.
    OnItemclick you will get which position is clicked and hence from the arraylist you can get what is the path of the image.

    ArrayList<String> listOfAllImages = new ArrayList<String>();
    String absolutePathOfImage = null;
    uri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
    
                String[] projection = { MediaColumns.DATA,
                        MediaColumns.DISPLAY_NAME };
    
                cursor = activity.managedQuery(uri, projection, null, null, null);
                column_index = cursor.getColumnIndexOrThrow(MediaColumns.DATA);
    while (cursor.moveToNext()) {
    absolutePathOfImage = cursor.getString(column_index);
    listOfAllImages.add(absolutePathOfImage);
    }
    

    Thanks Deepak

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to Android development and Java. Have read around but I'm
I'm new at Eclipse and the Android applications making so here comes a very
Before I delve into it, I'm very new to Android and I have just
I am very new to Android programming, and I have read everywhere and I
I am very new to Android. I am working on application that must get
I'm new to android and have been stuck on this problem for a long
I'm rather new to Android Dev and I'm stuck at the very last part
Im very new to android/java and have been following a few youtube tutorials and
Very new to Android and trying to install a Android project from an SVN
I'm VERY new to android programming, so please forgive. I have an assignment in

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.