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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:20:36+00:00 2026-05-23T09:20:36+00:00

How my application works is once a user opens it, it will open to

  • 0

How my application works is once a user opens it, it will open to a screen where it will find out depending on the button the user clicks, how many holes of golf they want to play (18 or 9.) From there it will launch the main activity where, depending on what the user chose, will depend on the rules of the application. ie – If they choose 18, the save button wont activate until the 18th hole, same for 9, it will activate on the 9th hole. This will also trigger a final score notification, etc.

Im curious if I should create a separate class for 9 holes and 18 holes, or if I should just pass some sort of value from the open screen, to the main activity that sets the values at 9 or 18?

I guess I am curious on this programming etiquette as I am not very familiar with the best practice of something like this.

Entry screen will look something like this as of now (I have not finished 9 hole button or help button but will be the same as 18 unless launching a seperate class)

case R.id.button18Holes:

        //*********************************//
        //***LAUNCHES ACTUAL APPLICATION***//
        //*********************************//
        Intent myIntent = new Intent(src.getContext(), EasyPar.class);
        startActivityForResult(myIntent, 0);

        Intent iStartValues = new Intent(this, EasyPar.class);
        String[] startValues = new String[] {"18"};
        iStartValues.putExtra("strings", startValues);
        startActivity(iStartValues);

        break;

    case R.id.button9Holes:
        break;

    case R.id.buttonHelp:
        break;
    }

Im not sure if that string array is the proper way to pass one to another activity either?

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-05-23T09:20:37+00:00Added an answer on May 23, 2026 at 9:20 am

    Pure OO people would say you should create an abstract base class containing common operations and fields, and then for the specialisations, create sub classes. Case statements and if statements like you have above are not pure OO.

    Same goes for arrays in general – in pure OO you might have them as a field in a class, but any operations performed on them would be inside a class.

    Personally, I would say go with whatever you think will be easier to maintain, quicker to program and more obvious to other people reading the code. I guess that doesn’t really answer the question though 🙂

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

Sidebar

Related Questions

I have a web application that works in our stage/test environment fine but once
So, in my application the user can export their work to excel. It works
My application works with the MVC model. The model contains a Bindable class (BindableItemsClass)
My WPF application works fine on a number of machines, but now I get
My new ASP.NET MVC Web Application works on my development workstation, but does not
I have an C# form application that use an access database. This application works
I am developing a project for BB. The application works with the network and
I am using standard 3G connection for video streaming. Streaming Media application works fine.
We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use
I have an application that works pretty well in Ubuntu, Windows and the Xandros

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.