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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:38:58+00:00 2026-06-13T23:38:58+00:00

If I need to do 10 similar activities, is it better I do: 10

  • 0

If I need to do 10 similar activities, is it better I do:

  • 10 activities and 10 layout?
  • 1 activity and 10 layout?
  • 1 activity and change the UI with visibility gone/visible?

I need an answer for:

  1. performance
  2. formality
  • 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-13T23:38:59+00:00Added an answer on June 13, 2026 at 11:38 pm

    If you use multiple activities, you will get the advantage of using the android activity stack mechanism. So if you want your users to be able to navigate with the back button, then it’s the best bet.

    Also, if your activities are very similar, then you can implement common code in an abstract class, and make your 10 activities extend this common class, thus sharing some code.

    public abstract class CommonBehaviorActivity extends Activity {
        protected void buildCommonThings() {
            ((TextView)findViewById(R.id.title)).setText(getTitle());
            ((ImageView)findViewById(R.id.image)).setDrawable(...);
            }
    
        abstract protected String getTitle();
    }
    
    public class MyActivity1 extends CommonBehaviorActivity {
        ...
        protected String getTitle() {
            return "Title 1";
            }
    }
    

    and so on…

    Edit : Added some sample code to show how to share things that you want to see in every sub-activity. For example, if you have a list in each activity, then you can define a specific adapter in the sub-activities in a getAdapter() method, and bind your list to this adapter in the CommonBehaviorActivity as well as configure it (bind listeners, and so on…)


    On the other side, if you want to have a very fast switch between your activities, and you don’t need to be able to go “back” with the button, then visible/gone view is maybe better.

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

Sidebar

Related Questions

I'm a iOS Application developer.I need some similar tasks in many projects as example
Is there a URL encoding function in XSLT version 1? I need something similar
Has anyone an idea how pipebytes.com works ? I need to implement similar system
I will write an android program. for simplicity, it will need a connection similar
I need a search panel similar to the findpanel in devexpress. FindPanel is a
I need to split this/similar string to get the VALUE <a href=javascript:void(0); id=def_ name=color
I need to create a ranking of similar strings in a table. I have
i need to create a chart similar to this: link text Do you have
I need to implement a feature similar to the one provided by Microsoft Outlook
I need to develop a functionality similar to iTunes where when you right-click a

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.