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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:38:27+00:00 2026-05-26T12:38:27+00:00

I am trying to create my first game for android. I currently have a

  • 0

I am trying to create my first game for android. I currently have a title page with some graphics and a ‘start’ button.

What I am trying to do is load the game once the start button is pressed.

Here is my activity code:

 public class TitlePage extends Activity {

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    setContentView(new TitlePageView(this));
    }

The class TitlePageView deals with loading & placing the images on the canvas, checks if the button is pressed and draws some balls floating around the screen.

Once the button is pressed, I don’t really need anything at all from the TitlePageView class. Is there a way of deleting the current view, and calling setContentView() with a different view?

  • 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-26T12:38:28+00:00Added an answer on May 26, 2026 at 12:38 pm

    I think you have implemented your own SurfaceView class to show the game content, i.e.

    public class GameView extends SurfaceView implements ...... { ....}
    

    then in your TitlePage Activity, initilize an instance of the GameView, like:

    GameView mGameView=new GameView(this);
    

    When you want to show your game, simply call setContentView(mGameView);
    Of course, you may call something like mGameView.start() to start the game.

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

Sidebar

Related Questions

I'm new to NHibernate and trying to create my first mapping. I have created
First off, this isn't homework ;). I'm trying to create a wordsearch game from
I'm trying to create a game loop using this tutorial . I have tried
Trying to create my first iPhone app that would play back audio. When I
I am trying to create my first custom Print Dialog in C#. I found
I'm trying to create my first data mart. I am creating my dimension table
I am trying to create my first GUI application using (Java + Eclipse +
I'm trying to create a standard two-column form, where the first column is a
First, context: I'm trying to create a command-line-based tool (Linux) that requires login. Accounts
I'm trying, for the first time, to create a GUI in Ruby using Tk.

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.