Custom Activity

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>

Anyone know how to do this?

Where are you storing this TestActivity.java ?

AFAIK it should be in (ENGINEDIR)\Build\Android\Java\src\com\epicgames\ue4\ (i don’t have had a deep look at unrealbuildtool, but you could store it here until someone expert will clarify this)

What I’m doing is modifying directly the engine GameActivity class (located there).

Hey guys!

I wanted to start an activity by pressing a UMG button? How can I implement this?

Thanks!

You will need to write some C++ code to expose a Blueprint function to call Java using JNI.

Hi Chris
Thanks for your replay!
Where should I write my android activity( java functions ) and how to access them in my project?

You can write a plugin and register a UPL file to copy the java source to compile. Any hookup you need to the GameActivity can also be done in this file. Look at Gear VR or Google VR plugins for examples.

If you want to register your activity in AndroidManifest.xml, You can use ManifestApplicationAdditions.txt File.
In the path Build -> Android, Add the ManifestApplicationAdditions.txt File.
And, write the contents like this <activity android:name=“com.companyname.activity name” />.

Did you manage to add and launch the activity?
If so, could you send me your XML or tell me how you did it?
I have a java file in which there is an activity.
and I need it to start.
I have already made code that would launch methods from XML, but I still have a problem with launching the activity