I know we can call an activity from another android activity as described in this question. My question is can we call a native activity from android activity through an intent or by using any other way? If yes, how?
Android.mk
file of my native activity is following and native activity code is building fine
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mynativeactivity
LOCAL_SRC_FILES := main.c
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
I am using this piece of xml to include my native activity in AndroidManifest.Xml
file. And I think I am making a mistake here.
//...rest of the xml including my main java activity here
<activity android:name="android.app.NativeActivity" android:label="mynativeactivity" >
<meta-data android:name="android.app.mynativeactivity" android:value="native-activity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Can anyone tell me how can I fix XML above so that in my first java based activity I can do something like this (if it is possible)
Intent intent = new Intent(this, mynativeactivity.class);
startActivity(intent);
Currently I can't compile this code because compiler cannot locate mynativeactivity