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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:13:53+00:00 2026-05-26T15:13:53+00:00

button3.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub

  • 0
      button3.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

                button3.setBackgroundResource(R.color.buttonDarkSelected);
                button4.setBackgroundResource(R.color.buttonMediumUnselected);
                button3.setTextColor(R.color.yellow);


        }
    });
    button4.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

                button4.setBackgroundResource(R.color.buttonDarkSelected);
                button3.setBackgroundResource(R.color.buttonMediumUnselected);
                button4.setTextColor(R.color.yellow);

        }
    });

}

I am trying to change Button’s background and textcolor clicking in that buttons. the background is fine working fine but textcolor always black (instead I want it be yellow) what’s my problem here.

  • 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-26T15:13:54+00:00Added an answer on May 26, 2026 at 3:13 pm

    Try this:

    button4.setTextColor(getApplication().getResources().getColor(R.color.yellow));

    This will work to change the text color to yellow

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

Sidebar

Related Questions

I have this code: button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //
Here's my code: myButton.setOnClickListener( new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1)
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button1 = (Button) findViewById(R.id.button1); button1.setOnClickListener(new
I'm trying to execute this JSON call as follows: button.setOnClickListener(new OnClickListener() { @Override public
This code is not work properly. Button button = (Button)findViewById(R.id.button_start); button.setOnClickListener(new OnClickListener() { @Override
with this code, my program just force close(error) ***public View x = findViewById(R.string.nfoname);*** @Override
public void onListItemClick(ListView parent, View v, int position, long id) { super.onListItemClick(parent, v, position,
package com.ebonybutler.cexample3; import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener;
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Log.d(LOG_TAG,
I have a popup text view with a next button and onClick I would

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.