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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:14:25+00:00 2026-06-13T08:14:25+00:00

I would like to do the same thing than the GMail application on Honeycomb

  • 0

I would like to do the same thing than the GMail application on Honeycomb tablets.
When you click on the Refresh button, the icon is replaced by a ProgressBar.
How can I do this?

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-13T08:14:26+00:00Added an answer on June 13, 2026 at 8:14 am

    Ok, I tried what Cailean suggested but it didn’t work for me. Every time I want to revert indeterminate progress to the original button it becomes unclickable, I used this layout for the progress

    (actionbar_refresh_progress.xml)

    <?xml version="1.0" encoding="utf-8"?>
    <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="32dp"
                 android:layout_height="32dp"
                 android:layout_gravity="center"/>
    

    and this one to revert to the button

    (actionbar_refresh_button.xml)

    <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
               android:src="@drawable/ic_menu_refresh_holo_light"
               android:layout_height="wrap_content"
               android:layout_width="wrap_content"/>
    

    my code was:

    private void setRefreshing(boolean refreshing) {
            this.refreshing = refreshing;
            if(refreshMenuItem == null) return;
            View refreshView;
            LayoutInflater inflater = (LayoutInflater)getActionBar().getThemedContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
            if(refreshing)
                refreshView = inflater.inflate(R.layout.actionbar_refresh_progress, null);
            else
                refreshView = inflater.inflate(R.layout.actionbar_refresh_button, null);
    
            refreshMenuItem.setActionView(refreshView);
        }
    

    After browsing the source of the Google IO app, especially this file: http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/ui/HomeActivity.java i found another easier way.

    Now I need only the first layout with progress and the working method looks like this:

    private void setRefreshing(boolean refreshing) {
        this.refreshing = refreshing;
        if(refreshMenuItem == null) return;
    
        if(refreshing)
            refreshMenuItem.setActionView(R.layout.actionbar_refresh_progress);
        else
            refreshMenuItem.setActionView(null);
    }
    

    Menu item definition:

    <item android:id="@+id/mail_refresh"
          android:title="Refresh"
          android:icon="@drawable/ic_menu_refresh_holo_light"
          android:showAsAction="always"/>
    

    I hope someone finds this useful.

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

Sidebar

Related Questions

I would like to ask the same thing than this question but using SWT:
What I'm looking at doing is essentially the same thing a Tweet button or
I have an application where I receive streaming data through bluetooth and would like
In jquery that is. I would like something that works as the success-pararameter, but
I want something like the following but would like it to be reusable for
I would like to do something like this: abstract class Foo { public function
I would like to do something like this in HTML5 where I have something
I would like to recreate something like this if ( arg1 || arg2 ||
I would like to run something like: select * from table where field in
I would like do something like that. list_of_urls = ['http://www.google.fr/', 'http://www.google.fr/', 'http://www.google.cn/', 'http://www.google.com/', 'http://www.google.fr/',

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.