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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:52:45+00:00 2026-06-10T15:52:45+00:00

I am trying to develop the functionality, where the user can click on the

  • 0

I am trying to develop the functionality, where the user can click on the image to select an image to upload on the same view being clicked. I define the ImageView as follows

    <ImageView
     style = "@style/DefaultButton"
     android:id="@+id/choose_img"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_centerHorizontal="true"
     android:layout_marginTop="46dp"
     android:clickable="True"
     android:adjustViewBounds="true"
     android:onClick="chooseImg"
     android:contentDescription="@string/description_logo"
     android:src="@drawable/user2" />

the method chooseImg is as follows

    public void chooseImg(View view){
        Toast.makeText(this, "Choose Image from Gallery", Toast.LENGTH_SHORT).show();
        Intent chimg = new Intent(Intent.ACTION_GET_CONTENT);
        chimg.setType("image/*");
        startActivityForResult(chimg,CHOOSE_IMAGE_REQUEST_CODE);
    }

The method is not being called. please help me out to know the reason. Thanks :).

  • 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-10T15:52:46+00:00Added an answer on June 10, 2026 at 3:52 pm

    The method that gets called by android:onClick must match the method that you want to be executed… But your method on onClick is captureImg and your method name in activity is chooseImg. Change these to the same method name and it should solve your problem. Also see my comment.

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

Sidebar

Related Questions

I am trying to develop a functionality and I need to offer user a
I am trying to develop a MVC3 (razor) application with Select language functionality. Using
Trying to develop a test app wherethe look is like ebook. user can flip
I am trying to develop an application for my localhost on which I can
I am trying to develop the XMPP Gateway which can send/receive from standard XMPP
I am trying to develop a functionality in JSP-Servlets where I need to log
I am trying to develop a FilterEditor using ExtJS. user creates some range, comparison,
Iam trying to develop a web application, where when a button is clicked the
I am trying to develop a drag/drop functionality that works on both desktop and
Iam trying to develop an iphone app having tab view as the base, within

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.