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

The Archive Base Latest Questions

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

I have three buttons in my Activity with three separate onClickListeners set like I

  • 0

I have three buttons in my Activity with three separate onClickListeners set like I have done plenty times before. But one of the listeners does not react to a click event and I have no clue as to why. Here is the code segment:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.edit_reminder_2);

    //References to layout resources
    edit2Back = (Button) findViewById(R.id.edit2Back);
    edit2Next = (Button) findViewById(R.id.edit2Next);
    edit2ChangeGPS = (Button) findViewById(R.id.edit2ChangeGPS);

    //Assigning listeners to Buttons
    edit2Back.setOnClickListener(listenerBack);
    edit2Next.setOnClickListener(listenerNext);
    edit2ChangeGPS.setOnClickListener(listenerChange);

}

final OnClickListener listenerNext = new OnClickListener() {

    public void onClick(View v) {
        Log.v("edit2Next","Click!");
        db.open();

        String sName = edit2ReminderName.getText().toString();
        String sNote = edit2ReminderText.getText().toString();
        int sRadius = Integer.parseInt(edit2Radius.getText().toString());
        String sUnits = (String) edit2SpinnerUnits.getSelectedItem();
        int sChecked = 0;
        if (edit2Check.isChecked()) {
            sChecked = 1;
        }

        db.insertReminder(sName, sNote, lat, lon, sRadius, sUnits, sChecked);

        db.close();

        Intent intent = new Intent(context, Reminders.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
    }

}; 

All my other listener I wrote in the same fashion and they work perfectly fine, but this one does not. I looked all over the code but could not find the reason. The listener does not start at all, not even the Log.v instruction runs. Thanks for your advice!

EDIT:

This is part of the XML code where i define my Buttons:

<LinearLayout 
    android:id="@+id/edit2ControlLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@color/azure"
    android:padding="15dp"
    android:orientation="horizontal" >

    <Button 
        android:id="@+id/edit2Back"
        android:layout_height="wrap_content"
        android:layout_width="0.0dip"
        android:text="Back"
        android:background="@drawable/round_button_violet"
        android:textColor="@color/azure"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:layout_weight="1.0"
        android:layout_marginRight="5dp" />

    <Button 
        android:id="@+id/edit2Next"
        android:layout_height="wrap_content"
        android:layout_width="0.0dip"
        android:text="Next"
        android:background="@drawable/round_button_violet"
        android:textColor="@color/azure"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:layout_weight="1.0"
        android:enabled="false" />        


</LinearLayout>
  • 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:49:05+00:00Added an answer on June 10, 2026 at 6:49 am

    Please remove android:enabled=”false” in your next button code in-order to work next button.

    <Button 
        android:id="@+id/edit2Next"
        android:layout_height="wrap_content"
        android:layout_width="0.0dip"
        android:text="Next"
        android:background="@drawable/round_button_violet"
        android:textColor="@color/azure"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:layout_weight="1.0"
        android:enabled="false" /> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an activity that has 12 buttons, and each one plays a separate
I want to unload activity .Actually i have three buttons one for login ,proceed
I have one label field and three buttons with the name of red, yellow,
Lets say I have one row with three columns - some buttons on left
I have a project which has gui consisting of three buttons.Now one of these
Can some one tell me were i am going wrong. i have three activity's
My situation is following. I have one Activity that contains three main parts. At
I have a tabhost with three tabs. Each is an activity. I would like
i have three classess.activity,service and appwidget. i have two buttons in appwidget. and onclicking
I have three buttons sending different variables to an activity: Intent i = new

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.