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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:51:36+00:00 2026-06-17T20:51:36+00:00

I am using new activities for ActivityButtons. So I have like 10 different activities,

  • 0

I am using new activities for ActivityButtons. So I have like 10 different activities, all of them using the same footer. In the footer, there are buttons and lots of click events. I just copy pasted all the listener events for Footer buttons to a few other activities to test it. It works but I need to find a way to keep them all together somewhere so that I will modify only once when I need to.

I tried keeping all common methods in a separate utility class by making them static, however it has a limited use. I am having issues with references and non-static methods.

In my research I have read about the ViewFlipper. Would it be better if I used a single MainActivity for everything and a ViewFlipper to switch between layouts. I have read that this might cause some resource issues, since the one and only activity will be active all the time.

Do you have any suggestions for this problem?

Thanks in advance.

  • 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-17T20:51:37+00:00Added an answer on June 17, 2026 at 8:51 pm

    There are a few things to consider.

    Fist is that footers are a somewhat problematic design pattern on android. Because of devices with soft buttons right below the screen area it is very easy for users to accidentally click system buttons when they are aiming for footer, and vice versa. If you are dead set on using a footer I suggest that you leave ample margin between it and the bottom edge of the screen to help mitigate this.

    You have a few options for how to handle the layout and click listeners. You could make the footer into its own Fragment And simply add it to each Activity that needs it. This is arguably the more difficult approach, but it would provide a good learning experience with Fragments if you are up for the challenge.

    Another option is to but all of your footer click listeners inside their own activity and then extend that with all of your other activities. Something like this:

    public class FooterActivity extends Activity{
        Button btn1
        //...
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.id.yourLayout);
            btn1 = (Button)findViewById(R.id.btn1);
            btn1.setOnClickListener(yourClickListener);
            //...
        }
    }
    

    Then in your normal activities change extends Activity to extends FooterActivity

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

Sidebar

Related Questions

all I have difficulty in linking the two activities by using two buttons. The
I am creating some buttons pragmatically. Using the same code from 2 different activities
Well i have 2 activities, say A and B, user zipping between them like
I am using intent-extra in two different activities and is then storing them using
when using new Date,I get something like follows: Fri May 29 2009 22:39:02 GMT+0800
Can I call constructor explicitly, without using new , if I already have a
i am using the following method in a new application i'm developing. there is
I'm sharing some variables accross activities by using a class like this : public
I'm pretty new to Android and I need some guidance. I have two activities
I have a series of 3 activities, and the 3rd activity binds (I'm using

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.