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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:43:31+00:00 2026-06-01T21:43:31+00:00

I am switching gears from iOS to Android and I was wondering about how

  • 0

I am switching gears from iOS to Android and I was wondering about how you re-use your view configuration in Android. In iOS I would typically create a BaseViewController that handled how my app would be “themed” and configured some common view components I wanted to be available everywhere and always (or with conditionals). I would then subclass BaseViewController to suit my view-specific needs. This may not be the ideal way to handle this sort of thing but it worked for me.

In Android I am not sure what I am supposed to do.

There appear to be far more options available for view configuration; I know that you can, like iOS, create views by inflating from XML layout files OR by creating them programatically. I also know that since Java offers inheritance, you could extend the Activity class. So I see a few paths: you could create a base_view.xml file and include it in future layout files, but I see this as being kind of hacky for some reason. You could also create that base_view.xml file, use it in a non-implementable BaseActivity class, and subclass BaseActivity to an implementable and activity-specific version. Or, you could do it programatically in BaseActivity and subclass. I am also vaguely aware of “theme” options in Android that may simplify some of this.

I am almost certain I am going about this in the wrong way and that there are thousands of people who have had to deal with re-using some view configuration before, so all help is appreciated.

  • 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-01T21:43:35+00:00Added an answer on June 1, 2026 at 9:43 pm

    There are many different things you may want to re-use. You are not being as specific as we would like to. For instance, these are just some of the things you may want to re-use:

    • Styles and themes: If your concern is only how the app looks, then you just have to create a theme and applied to your whole application. You do so by configuring the android:theme attribute in the application tag of your AndroidManifest.xml file.
    • Basic layout: as you may already know, android apps usually use actionbar ui pattern. For that kind of things, you can create a BaseActvitiy which handles and configures the actionbar (take a look at the iosched app source code). However, what I recommend in these cases is stick to libraries like ActionBarSherlock which will make things easier and nicer.
    • Behavior: for instance, you want to have a search button in all your activities and all it does is calling the startSearch method. In those cases inheritance is encouraged.
    • UI components: for instance, you want to reuse some dialogs. In those cases, and most of the OOP cases, composition is encouraged over inheritance. You will learn that for most of those cases you will need to be passing around your activity reference (as a Context). For this case, and in general, I highly recommend you to stick to the support library so that you can use the Fragments API; I know it could be somehow difficult to use at first, but it definitely worths the effort.

    If your needs are more specific do not hesitate to comment so that I can try to advice how to proceed.

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

Sidebar

Related Questions

Switching over from sqlite to MongoDB and I followed all of the setup/configuration settings
After switching from C++ to C++ w/boost, do you think your OOD skills improved?
After switching my Android NDK from android-ndk-r8b (official) to android-ndk-r7-crystax-5.beta2 (unofficial Crystax build), my
jquery ui switching from tab view to one view works fine with single tab
I am currently switching languages from Java(beginner) to c++ and would like to replicate
Switching from JVM 1.4 to 1.5 has performance benefits as per release notes. http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#performance
After switching from firefox testing to internet explorer testing, some elements couldn't be found
Does switching activities in Android start a fresh JVM? It seems like each activity
Switching from Microsofts Oracle Driver to ODP.NET version 10.2.0.100. After changing the data types
We are switching from a non-clustered to a 2-node clustered MSMQ Windows Server 2008

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.