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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:21:09+00:00 2026-06-10T20:21:09+00:00

I am new on android programming, just did one app so far. After it’s

  • 0

I am new on android programming, just did one app so far. After it’s completed, I start to think about the architecture of android application.

In my app, I use Activity as Controller similar and setContentView to add layout View, this one is working and when it switch to another View, commonly I will use another Activity, or ViewFlipper or multi View in the same Activity, switch them by using setContentView method.

Now I am thinking is it good to change this architecture to this one –

Activity

Controller

View – Layout XML

Controller class is independent from Activity, so it will be like this –

class Controller {

    public View view;

    .....

    // logic to deal with view operation
    public void init ()
    {
    }
}

Activity will be like this –

class MyActivity extends Activity {

    ControllerOne c0 = null;
    ControllerTwo c1 = null;

    .....

    protected void switchView (Controller c)
    {
        setContentView (c.view);
        c.init (); // or something else to restore states of this controller
    }
}

I don’t know if this one is fine for android app architecture, or is there any good ideas about android app architecture? Thanks.

  • 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-10T20:21:11+00:00Added an answer on June 10, 2026 at 8:21 pm

    I don’t think it’s a good idea to ignore Android’s MVC architecture. An activity class acts as a controller. But if you want to achieve something like using more than 1 controller for an activity, you should see Android’s Fragments.

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

Sidebar

Related Questions

i am new to android programming and i am trying to develop an app
I am new to android programming and i am trying to develop this app
I'm new to Android programming, so I'm facing some general problems about choosing the
I have just began opengl programming in android and i am fairly new to
Am new to android programming, just started learning it the past 6 weeks and
I'm new to Android programming and trying to wrap my head around this just
I'm new with Android programming. I'm just wondering whether its possible to set up
I'm very new to Android programming and am having a rough start. I've created
I'm new to android programming. I would like to make an app widget that
I'm new to Android app programming and started to read a book, but it

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.