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

  • Home
  • SEARCH
  • 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 9287555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:42:05+00:00 2026-06-18T19:42:05+00:00

I don’t know why the last two buttons is not clickable, I used the

  • 0

I don’t know why the last two buttons is not clickable, I used the background (that i set to them ) many time and it works with another layouts, I am sure that the wrong is something like foucable or clickable but i don’t know where exactly .

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:fillViewport="true" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:orientation="vertical" >

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1" >

                <Button
                    android:id="@+id/b_orderMeal_selectRestaurant"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="30dip"
                    android:text="@string/b_selectRestaurant" />

                <ImageView
                    android:id="@+id/iv_orderMeal_isSelectRestaurant"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_alignParentRight="true"
                    android:contentDescription="@string/iv_isSelected"
                    android:src="@drawable/x" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1" >

                <Button
                    android:id="@+id/b_orderMeal_selectMealItems"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="30dip"
                    android:text="@string/b_select_MealItems" />

                <ImageView
                    android:id="@+id/iv_orderMeal_isSelectMealItems"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_alignParentRight="true"
                    android:contentDescription="@string/iv_isSelected"
                    android:src="@drawable/x" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1" >

                <Button
                    android:id="@+id/b_orderMeal_selectPayMethod"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="30dip"
                    android:text="@string/b_selectPayMethod" />

                <ImageView
                    android:id="@+id/iv_orderMeal_isSelectPayMethod"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_alignParentRight="true"
                    android:contentDescription="@string/iv_isSelected"
                    android:src="@drawable/x" />
            </RelativeLayout>

            <Button
                android:id="@+id/b_orderMeal_checkBasket"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="40dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1"
                android:text="@string/b_check_basket" />

            <TextView
                android:id="@+id/tv_orderMeal_errorMessage"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20dip"
                android:layout_marginRight="20dip"
                android:layout_marginTop="30dip"
                android:layout_weight="1"
                android:text="@string/tv_orderMeal_errorMessage"
                android:textColor="#FF0000"
                android:textSize="20dip"
                android:textStyle="bold"
                android:typeface="sans" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="@drawable/bg_selector"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/b_orderMeal_send"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="4dip"
                android:layout_weight="1"
                android:background="@drawable/button_bg"
                android:text="@string/b_send"
                android:focusable="true"
                android:clickable="true"
                android:textColor="#FFFFFF" />

            <Button
                android:id="@+id/b_orderMeal_cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="4dip"
                android:layout_weight="1"
                android:background="@drawable/button_bg"
                android:text="@string/b_cancel"
                android:clickable="true"
                android:textColor="#FFFFFF" />
        </LinearLayout>
    </RelativeLayout>

</ScrollView>

I am talking about the last two buttons

java

b_send = (Button) findViewById(R.id.b_orderMeal_send);
        b_send.setOnClickListener(this);
        b_cancel = (Button) findViewById(R.id.b_orderMeal_cancel);
        b_cancel.setOnClickListener(this);

on click

@Override
    public void onClick(View v) {
      case R.id.b_orderMeal_cancel:
        Toast.makeText(this, "roma", Toast.LENGTH_LONG);
        break;          
    }

note

the toast doesn’t appear

  • 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-18T19:42:07+00:00Added an answer on June 18, 2026 at 7:42 pm

    I don’t know why the last two buttons is not clickable, I used the
    background (that i set to them ) many time and it works with another
    layouts, I am sure that the wrong is something like foucable or
    clickable but i don’t know where exactly .

    I think your XML design is OK in all ways so problem is most likely in Java. Most likely you forgot to register OnClickListener for your Button(s).

    Button btn = (Button) findViewById(R.id.b_orderMeal_send);
    btn.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
           Toast.makeText(this, "Click event works.", Toast.LENGTH_SHORT).show();
         }
     }));
    

    Or you can use OnClickListener interface and then

    public void onClick(View v) {
       switch (v.getId()) {
          case R.id.b_orderMeal_send:
             Toast.makeText(this, "Click event works.", Toast.LENGTH_SHORT).show();
          break;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't know what's going on, but for some reason my background image is not
Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
Don't know if I'm using the not selector incorrectly but I want everything clicked
Don't know why people do not practice AJAX implementation for authentication systems. Is it
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't worry, I'm not going to ask that question, yet again... I am wanting
Don't know if I'm over-thinking this or not.. but I'm trying to be able
Don't yell at me! i have seen many threads claiming that HTML cannot be
Don't know if there is a better way to do this, so that is
don't know if the title describes anything about what I'm trying to say but

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.