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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:06:11+00:00 2026-06-11T10:06:11+00:00

I have an Activity which is resumed with @Override protected void onResume() { Log.v(TAG,

  • 0

I have an Activity which is resumed with

@Override
protected void onResume() {
            Log.v(TAG, " onResume() disables the OK button");
    // onAuthentificated will re-enable it
    findViewById(android.R.id.button1).setEnabled(false);
    super.onResume();
}

Later, the authentification is successful, and my callback is called

@Override
public void onAuthenticated(String username) {
    Log.v(TAG, "user can press button");
    findViewById(android.R.id.button1).setEnabled(true);
    super.onAuthenticated(username);
}

I know that the setEnabled(true) is called last.

My problem is that the button remains greyed out. What’s happening and how can I fix this?

The layout(but it won’t help)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/VerticalLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <!-- other stuff --> 
    <Button
        android:id="@android:id/button1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:text="@android:string/ok" />

</LinearLayout>

Here are the last lines of logcat

08-30 13:00:45.182: V/ReportActivity(344): onResume() disables the OK button
8-30 13:00:45.382: I/ReportActivity(344): Authentification token callback
08-30 13:00:45.477: D/dalvikvm(344): GC_CONCURRENT freed 324K, 5% free 9960K/10375K, paused 2ms+3ms
08-30 13:00:45.567: D/NetworkService(344): Broadcast the fact user is authenticated
08-30 13:00:45.567: D/ReportActivity(344): user can press button
  • 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-11T10:06:13+00:00Added an answer on June 11, 2026 at 10:06 am

    The solution is to store the result of findViewById(android.R.id.button1) in a field that is initialized by the onResume() method.

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

Sidebar

Related Questions

I have a activity which has a button and 2 autocomplete widget. for the
Guys I have an activity which has a home button, when the button is
I have an Activity which has an 'OK' button. And I have an 'Edit'
I have an Activity A which has a "down" button (see image above). When
I have an activity which is going to switch around between several views, and
I have an Activity which shows a welcome message if started for the first
I have an activity which shows some List entries. When I click on a
I have an activity which needs to make two remote server calls. The first
I have an activity which uses two Loaders. Each of them returns different type
I have an activity which consists of a ListView . The problem is that

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.