after a long search I couldn't find any appropriate solution. I have a Android-Library Project with nearly all code for the application. From the main activity in the library project I start an Intent to en explicit Activity A. In my derived Project, which uses the library Project, I have extended this Activity A and added some new code. The problem is that the the Superclass of Activity A will respond and not the derived class.
In the manifest of the new Project which uses the library project I have declared the new Activity with the new package.
Here is the Intent call from the Library Project:
Intent i = new Intent(getApplicationContext(), AndroidActivity.class);
startActivity(i);
Here is the derived AndroidActivity class:
public class AndroidActivity extends de.app.library.activities.AndroidActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
I am not able to get to the onCreate Method
The Manifest from the Library Project:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.app.library"
android:versionName="1.0"
android:versionCode="1">
<uses-sdk android:minSdkVersion="4" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".activities.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.AndroidActivity" android:label="@string/act_android" />
</application>
And here the Manifest from the new Project:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.app.free"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name="de.app.library.activities.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.LernenActivity" android:label="@string/act_lernen" />
So I have:
de.app.library.activities.AndroidActivity and
de.app.free.activities.AndroidActivity
I didn't want to do that much changes to the library project beacuase a third project should use the existing code with the untouched AndroidActivity
ALl other things works fine for me. For example the changed layouts are used from the new project.
How can I handle that problem? Maybe changes in the Manifest from the new project in which I declare, that the new activity should be called instead of the superclass?
Thanks in advance!