Adding Custom Android Activity Java File

The engine uses GameActivity.java found at (Engien\Build\Android\Java\src\com\epicgames\ue4) as the android activity when launching the application (referred to inside AndroidMenifest.xml) and places it inside your projects Intermediates at compile time.

When the project gets built I want to use my own android activity. Is this possible?

Can I use GameActivity.java along with my custom.java activity? How?

Hello pal,

Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes. If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, could you please submit a new report for it.

Thank you.

Bump this question. I also need this functionality. When I try add my custom activity I get this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.epicgames.TheTaleOfThreeMobile/com.epicgames.ue4.GameActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.epicgames.TheTaleOfThreeMobile/com.epicgames.ue4.TestActivity}; have you declared this activity in your AndroidManifest.xml?

But I declared this activity in AndroidManifest.xml:

activity android:name="com.epicgames.ue4.TestActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:launchMode="singleTask"
            android:screenOrientation="landscape"
            android:debuggable="true"
            android:configChanges="orientation|keyboardHidden">
            <meta-data android:name="android.app.lib_name" android:value="UE4"/>
        </activity>

I’m not sure if you should add new main activity. Can you try add it like the AdActivity is added?

<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

Check your package name. Not sure that you wanted to call the activity com.epicgames.ue4.TestActivity if your app package is com.epicgames.TheTaleOfThreeMobile.