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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:08:08+00:00 2026-06-13T04:08:08+00:00

I used to use SimpleBaseGameActivity for my app and everything was ok, but now

  • 0

I used to use SimpleBaseGameActivity for my app and everything was ok, but now I want to add some ads into the app, so I tried to use LayoutGameActivity. But I get the render view is completely black and I don’t know why. That’s my code:

public class AcGame extends LayoutGameActivity {
    [...]
    @Override
    protected int getLayoutID() {
        return R.layout.ad;
    }

    @Override
    protected int getRenderSurfaceViewID() {
        return R.id.layout_render;
    }

    @Override
    public EngineOptions onCreateEngineOptions() {
        [...]
        return new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, resolution, camera);
    }

    @Override
    public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) throws Exception {
        createResources();
        pOnCreateResourcesCallback.onCreateResourcesFinished();
    }

    @Override
    public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback) throws Exception {
        pOnCreateSceneCallback.onCreateSceneFinished(createScene());
    }

    @Override
    public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {
        pOnPopulateSceneCallback.onPopulateSceneFinished();
    }

And that’s my layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="top"
            android:id="@+id/layout_ad"
            >
        <Button
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="Ad Sample"/>
    </LinearLayout>
    <org.andengine.opengl.view.RenderSurfaceView
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:gravity="center"
            android:id="@+id/layout_render"
            />

</LinearLayout>

When I’m trying to debug, I can see that EngineOptions are creating, but no one of the LayoutGameActivity’s methods was called (onCreateResources, onCreateScene or onPopulateScene). Can someone tell me what I’ve missed?

UPD: I’ve found that if to move button in xml down, scene is showing:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
    <org.andengine.opengl.view.RenderSurfaceView
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:gravity="center"
            android:id="@+id/layout_render"
            />
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="top"
            android:id="@+id/layout_ad"
            >
        <Button
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="Ad Sample"/>
    </LinearLayout>

</LinearLayout>

But now I can’t see my button and all seems like I’m still using SimpleBaseGameActivity.

  • 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-13T04:08:09+00:00Added an answer on June 13, 2026 at 4:08 am

    I’ve found the solution: If you want to use (Simple)LayoutGameActivity, you have to use RelativeLayout.
    Also if you use LayoutGameActivity instead of SimpleLayoutGameActivity, don’t forget to use callbacks!

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

Sidebar

Related Questions

I used to use an add-on for firefox called measureit. Now its not working
I used to use the function below for an array or IP's but now
I used to use 'GetSchemaTable' to read schema information, but it was missing some
I used to use singleton get a single instance, but it was disclaimed by
I used to use netbeans for a while and really liked it. But now,
I used to use Eclipse Galileo, but now I have Helios. Galileo used to
we used to use a farpoint grid which made this quite easy but now
I used to use getItems get all items in a dropdownList. http://developer.rallydev.com/developer/iteration-dropdown but in
I used to use procedural-style PHP. Later, I used to create some classes. Later,
I used to use SVN 1.4 on OS X Leopard and everything was fine.

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.