2

I need to create 2 native activities in my android app where one activity will be communicating with another. I would like to avoid java coding involved, there is a way to do that if activity name is set as

android:name="android.app.NativeActivity"

The problem is that I cannot declare 2 activities with the same name and in order to avoid this problem I have to do something silly like defining another class as a dummy extension of NativeActivity

public class MyAnotherActivity extends NativeActivity {}

and then I can have both the activities declared in my manifest:

        <activity android:name="android.app.NativeActivity"
...
        </activity>

        <activity
            android:name="MyAnotherActivity"
...
        </activity>

This looks odd to me, maybe there is a better way to do that without creating dummy java files ?

I would expect ability to declare several native activities without involving java.

1 Answers1

0

I don't think you can.

But creating 2 Java Activity classes that do no more than extend from NativeActivity is trivial as you have shown in your question.

William
  • 20,150
  • 8
  • 49
  • 91