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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:56:54+00:00 2026-05-27T00:56:54+00:00

I couldn’t find any help that would work for me so this is a

  • 0

I couldn’t find any help that would work for me so this is a particular case scenario of starting an activity.
I have a project in which i have the class MrNom

public class MrNomGame extends AndroidGame {

    public Screen getStartScreen() {
            return new LoadingScreen(this);
    }

the AndroidGame class looks like this:

public abstract class AndroidGame extends Activity implements Game{
    /**
     * @uml.property  name="renderView"
     * @uml.associationEnd  inverse="game:ro.lasting.androidgames.framework.impl.AndroidFastRenderView"
     */
    public static AndroidFastRenderView renderView;//we draw to this and it manages the main loop thread
    /**
     * @uml.property  name="graphics"
     * @uml.associationEnd  
     */
    private Graphics graphics;
    /**
     * @uml.property  name="audio"
     * @uml.associationEnd  
     */
    private Audio audio;
    /**
     * @uml.property  name="input"
     * @uml.associationEnd  
     */
    private Input input;
    /**
     * @uml.property  name="fileIO"
     * @uml.associationEnd  
     */
    private FileIO fileIO;
    /**
     * @uml.property  name="screen"
     * @uml.associationEnd  
     */
    private Screen screen;//holds the currently active screen
    /**
     * @uml.property  name="wakeLock"
     * @uml.associationEnd  
     */
    private WakeLock wakeLock;//we use this to keep the screen for dimming

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*make activity fullscreen*/
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //setup artificial framebuffer
        boolean isLandscape = getResources().getConfiguration().orientation ==
        Configuration.ORIENTATION_LANDSCAPE;

        int frameBufferWidth = isLandscape ? 480 : 480;
        int frameBufferHeight = isLandscape ? 320 : 320;
        Bitmap frameBuffer = Bitmap.createBitmap(frameBufferWidth,
        frameBufferHeight, Config.RGB_565);//Bitmap instance has an RGB565 color format for not wasting memory and speed up the drawing
        //Calculate scaleX and scaleY values that SingleTouchHandler 
        // and MultiTouchHandler classes will use to transform the 
        // touch event coordinates to our fixed-coordinate system
        float scaleX = (float) frameBufferWidth / getWindowManager().getDefaultDisplay().getWidth();

        float scaleY = (float) frameBufferHeight / getWindowManager().getDefaultDisplay().getHeight();

        //renderView = new AndroidFastRenderView(this, frameBuffer);
        graphics = new AndroidGraphics(getAssets(), frameBuffer);
        fileIO = new AndroidFileIO(getAssets());
        audio = new AndroidAudio(this);
        input = new AndroidInput(this, renderView, scaleX, scaleY);
        screen = getStartScreen();

        setContentView(renderView);
        //if(ro.lasting.androidgames.mrnom.MainMenuScreen.sinvite)setContentView(ro.lasting.androidgames.mrnom.R.layout.invite);

        PowerManager powerManager = (PowerManager)
        getSystemService(Context.POWER_SERVICE);
            wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "GLGame");

    }

    public void onResume() {
        super.onResume();
        wakeLock.acquire();
        screen.resume();
        renderView.resume();
    }

    public void onPause() {
        super.onPause();
        wakeLock.release();
        renderView.pause();
        screen.pause();
        if (isFinishing())
            screen.dispose();
    }

    /**
     * @return
     * @uml.property  name="input"
     */
    public Input getInput() {
        return input;
    }

    /**
     * @return
     * @uml.property  name="fileIO"
     */
    public FileIO getFileIO() {
        return fileIO;
    }

    /**
     * @return
     * @uml.property  name="graphics"
     */
    public Graphics getGraphics() {
        return graphics;
    }

    /**
     * @return
     * @uml.property  name="audio"
     */
    public Audio getAudio() {
        return audio;
    }

    /**
     * @param screen
     * @uml.property  name="screen"
     */
    public void setScreen(Screen screen) {
        if (screen == null)
            throw new IllegalArgumentException("Screen must not be null");

        this.screen.pause();
        this.screen.dispose();
        screen.resume();
        screen.update(0);
        this.screen = screen;
    }
    public Screen getCurrentScreen() {
        return screen;
    }   
}

and I also have the corresponding manifest file which contains the following :

<activity android:name=".MrNomGame"
                  android:label="@string/app_name"
                  android.screenOrientation="landscape"
                    android:configChanges="keyboard|keyboardHidden|orientation">
             <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

This app works just fine.
But if I try to put this in another app, I get force close.
My other project is this:

public class MainActivity extends Activity{
     @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.endgame);      

             Intent intent = new Intent(this,MrNomGame.class);
             //intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             startActivity(intent);
     }

with the coresponding manifest file :

<activity android:name=".MainActivity" android:theme="@style/ThemeFullScreenNoTitle"
            android:label="@string/app_name" android:screenOrientation="landscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".MrNomGame" android:label="@string/app_name"
            android.screenOrientation="landscape" android:configChanges="keyboard|keyboardHidden|orientation">

I would expect this to work but it doesn’t. I tryed all day and I can’t get my first class (MrNomGame) running from my MainActivity. However on it’s own it works just fine as seen on the first part of my question. Sorry for this big piece of code and big question but I just wanted to make it easier for you to understand this specific problem I am getting. So, how can I start MrNomGame from my main activity ? 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-05-27T00:56:54+00:00Added an answer on May 27, 2026 at 12:56 am
                          android:name=".MrNomGame"
    

    This wont work, try using fully qualified name. Lyk

                    android:name="YourPackageName.MrNomGame"
    

    Sorry if I am completely wrong.

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

Sidebar

Related Questions

Couldn't find an answer to this one. I have a WPF ListView control that
I couldn't find the answer to this in any other question. Suppose that I
I couldn't find any explanation for the following problem. Hope you to help me
Couldn't find anything relevant in forums So ,Please help me with this code .I'm
I couldn't find any definitive answer to this question. I suppose most implementation use
Couldn't find any documentation about this: what is the order of execution of the
Couldn't find any good information on how to do this so I thought I'd
Couldn't find any answer to this problem, or not even any questions asked. So
couldn't find my solution. hope you can help. I want to have a url
Couldn't find anything about this topic. I have a Windows TCP C++ server application

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.