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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:08:16+00:00 2026-06-08T01:08:16+00:00

i stuck with a unusual problem i have a restaurant application which includes menu

  • 0

i stuck with a unusual problem
i have a restaurant application which includes menu icons fixed at the bottom of every layout,
my problem is i dont want to create onsetclicklistner() method of every icon on each of my activity class….
please give some suggestion so that i can make a common class where i can put all my footer icon click event and activities in it and use it on my every activity class with different setcontentview…
hope you all get my question…
looking forward for your reply

  • 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-08T01:08:17+00:00Added an answer on June 8, 2026 at 1:08 am

    You don’t need to setup onClickListeners programmatically. You can also put them in the layout XML like this:

    <Button android:id="@+id/my_button"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/my_button_text"
        android:onClick="myOnClick"
    />
    

    Then you can declare a base activity class that contains this method in it, like this:

    public class BaseActivity extends Activity {
        public void myOnClick(View v)  {
            // Do whatever you want to do when the button is clicked
        }
    }
    

    Then you write all of your activity classes so that they derive from BaseActivity instead of Activity.

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

Sidebar

Related Questions

I have an unusual problem that caused my mind to stuck. I have created
Kinda stuck here... I have an application with lets say 5000 rows of data
I stuck with problem of mail application , i am developing a website for
im stuck in my problem, i have invoke a process and now i want
I have a unusual problem throwing an exception An attempt was made to load
I'm stuck between some unusual problem.My app was running properly but I did some
Stuck with an unusual problem, would seem that I love doing things that's not
Stuck a layout problem with IE 6 & 7. Most (but not all) input
im stuck in this terrible problem, I have a SOAP based webservice implemented in
Stuck with a silly problem. I have an input field, where user can input

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.