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

  • Home
  • SEARCH
  • 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 8435109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:50:09+00:00 2026-06-10T06:50:09+00:00

In a xml, I am having LinearLayout . Inside that I am using an

  • 0

In a xml, I am having LinearLayout.
Inside that I am using an ExpandableListView.
Every expand item contain just one view which is a GridView.
A GridView cell compose with three UI components which are ImageView, TextView and a Button.
How I have got control about those three UI components is as follow,

public View getView(final int position, View convertView, ViewGroup parent) {

    LayoutInflater layoutInflater = (LayoutInflater) imageAdapterContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    if (convertView == null) {
        convertView = layoutInflater.inflate(R.layout.single_grid_item, null);
        viewHolder = new ViewHolder();
        viewHolder.singleImageView = (ImageView) convertView.findViewById(R.id.singleGridItem_imageView);
        viewHolder.singleTextView = (TextView) convertView.findViewById(R.id.singleGridItem_textView);
        viewHolder.singleDownloadButton = (Button) convertView.findViewById(R.id.singleGridItem_download_button);
    }
}

// ViewHolder is a static nested inner class

Things are working prety fine. That means each cell identify as different cells.
They have different images, and appropriate TextView labels and also Button click event also working fine.
For the button click I have used a downloading with a ProgressDialog. That also working fine.
What I want is disable the Button when the downloading in progress.
Downloading happening in a seperate AsyncTask class.
Please tell me how can I disable the button which user has clicked for downloading.

  • 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-10T06:50:10+00:00Added an answer on June 10, 2026 at 6:50 am

    Most of the time I have to wrte the answer for my own question.
    This one also the same.
    I have figure out the way.
    I have override the button click event in the getView() method as follow.

    viewHolder.singleDownloadButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
    
            // Some code goes here...
    
            new DownloadZipAsyncTask(imageAdapterContext, view).execute(zipFileUrl);
    
        }
    });
    

    By the time I click the Download button, I am passing the button view to the DownloadZipAsyncTask class.
    In that class, I am again creating Button instance and set the view invisible as follow in onProgressUpdate()

    Button mybutton = (Button) view.findViewById(R.id.singleGridItem_download_button);
    mybutton.setVisibility(View.INVISIBLE);
    

    For button, it is working. But I can’t change the ImageView or the TextView like that.
    Because in the click event, we only pass the Button view only.
    Therefore I am again in a problem with how to update a progress bar like that.
    Again, ProgressDialog is not a problem, only the ProgressBar UI component give the problem.

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

Sidebar

Related Questions

Having this XML view: <?xml version=1.0 encoding=utf-8?> <LinearLayout android:id=@+id/myScrollLayout android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical xmlns:android=http://schemas.android.com/apk/res/android> <ScrollView
I am having on xml from which i have to remove the one book
I'm having one empty Linear Layout in xml. And I'm adding some text view
Context: I have a TableLayout (created using XML), which has one TableRow, which has
Im having trouble with implementing list view inside a fragment. the xml code is:
How can I assign each view an automatic margin? Example: <?xml version=1.0 encoding=utf-8?> <LinearLayout
I'm having trouble adding a button to a layout that I've created in XML.
So I'm trying to put a LinearLayout that has two TextViews inside of a
I am having troubles with my XML in Android. In the graphical layout view
I am having one MapActivity in which first of all I am trying to

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.