Announcement

Collapse
No announcement yet.

Custom Activity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Custom Activity

    When I try add my custom activity I get this error:

    Code:
        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:
    Code:
        <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?

    #2
    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).
    WIP Save the princess !
    https://twitter.com/stp_the_game

    Comment


      #3
      Hey guys!

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

      Thanks!

      Comment


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

        Comment


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

          Comment


            #6
            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.

            Comment


              #7
              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" />.

              Comment

              Working...
              X