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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:29:21+00:00 2026-05-26T06:29:21+00:00

I’m building an app framework for Android tablets, and I am running into a

  • 0

I’m building an app framework for Android tablets, and I am running into a strange issue with some ImageButtons. These buttons (Next & Prev) are used to help navigate through “content pages” as part of the framework, and are using custom background drawables.

The issue is that whenever I click on the Prev button, the Next button highlights while the the Prev button does not. At first I thought it was a simple linking or @+id/ issue, but the Prev button’s action is performed, not the Next button’s.

Here is some relevant code:

In onCreate() method:

nextButton = (ImageButton) findViewById(R.id.nextButton);
prevButton = (ImageButton) findViewById(R.id.prevButton);
nextButton.setOnClickListener(this);
prevButton.setOnClickListener(this);

onClick method:

public void onClick(View v) {
    if(_cpp == null){
        finish();
    }else if (v == nextButton) {
        if (!_cpp.nextRes.equalsIgnoreCase("")) {
            // load next page
            _tempRes = _cpp.nextRes;
            //start transition out animations
            fadePageOut();
        } else {
            finish();
        }
    } else if (v == prevButton) {
        if (!_cpp.prevRes.equalsIgnoreCase("")) {
            // load previous page
            _tempRes = _cpp.prevRes;
            //start transition out animations
            fadePageOut();
        }
    }
}

My drawable XML:

<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:drawable= "@drawable/prev_arrowhigh" />
<item android:state_pressed="true" android:state_enabled="true"
    android:drawable="@drawable/prev_arrowhigh" />
<item android:state_focused="true" android:state_enabled="true"
    android:drawable="@drawable/prev_arrow" />
<item android:state_enabled="true" android:drawable="@drawable/prev_arrow" />
</selector>

I’ve been debugging and searching for answer for two days now, with no luck. The funny thing is it used to work just fine… but even reverting to a previous version of my project didn’t seem to help at all.

Has anyone encountered this issue before or have any idea what could possibly be the cause of this?

  • 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-26T06:29:22+00:00Added an answer on May 26, 2026 at 6:29 am

    Solved! stupid, stupid me…

    Next button was displaying as selected because in my code (part not posted) disables the button during my fadePageOut() method (see posted code). The state-drawable was simply using the wrong images for enabled/disabled states.

    This:

    <item android:state_enabled="false" android:drawable="@drawable/prev_arrowhigh"/>
    

    Should have been:

    <item android:state_enabled="false" android:drawable="@drawable/prev_arrow"/>
    

    two days wasted because of a incorrect image…
    *sigh*

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload

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.