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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:23:10+00:00 2026-05-28T19:23:10+00:00

i have implemented galleryview in one screen named display_image.xml in which i have shown

  • 0

i have implemented galleryview in one screen named display_image.xml in which i have shown various images available on sdcard now when user selects picture and presses save image button on same screen display_image.xml then selected image should be changed in his/her profile picture in another screen.

My question is that how would i be able to get that image from one screen to change picture of user in another screen and that selected image should also inserted in database for later retrival when user logs in later. Let me tell you that my image dont come from any webservice.

Please help me out……… Thanking You………

  • 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-28T19:23:11+00:00Added an answer on May 28, 2026 at 7:23 pm

    First thing you need to do is declare an Intent

    Intent i_cp = new Intent(this,ImagePicker.class);
    

    and use startActivityForResult(i_cp, 111); which will be looking for some result. in our case for position of image; an integer value.

    by specifying request_code (111) that will be used to identify result when returned by started intent. Here we wont use setAction(i_cp.ACTION_PICK); and setType("image/*"); because we are not going to return image we will just return the position of image. Our use of Intent will be limited to just passing and retrieving the integer value(position of value).

    Now how about to get that position of image that user has selected. position is got in onItemClick method of GalleryView by one of the parameters

    public void onItemClick(AdapterView parent, View v, int position,long rid)
    

    now declare one variable such as int pos; and assign -1 to identify whether the image is selected or not and if the image is selected then in onclick event of button saveimage pass value position as

    retIntent.putExtra("SelectedImage", pos);
    

    and in onActivityForResult identify intent by passed requestcode and extract that position as

    int pos = data.getExtras().getInt("SelectedImage");
    

    and set it as

    usr_im.setImageResource(ImagePicker.pics[pos]);
    

    and this array of pics[] which holds all ids of images stored in one of the res/drawable folder of your application, declare it as

    public static Integer[] pics={values};
    

    Otherwise you wont able to set the image.

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

Sidebar

Related Questions

I have implemented a simple linked list class and I would now like to
I have implemented a REST Webservice which returns (after an authentication via RFC 2617
I have implemented a multi-threaded program which involves spawning a thread for each user,and
I have implemented GalleryView. I want to display a border image on selected image
I have implemented the SortedBindingList class shown at http://www.martinwilley.com/net/code/forms/sortablebindinglist.html I have then successfully added
I have implemented button which clicks and opens dialog with spinner inside as described
I have implemented a console calculator application. It stores variables as well. Now I
I have implemented a custom designer class which inherits from DocumentDesigner. The standard Form
I have implemented a csv file builder that takes in an xml document applies
I have created a GalleryView and ImageView which displays the Image bigger when an

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.