I am getting an ActivityNotFoundException
for an activity which exists and is included in my applications AndroidManifest.xml
.
Here is my scenario:
My Application project package is: com.myapplynx.mytexteditor.android
.
My library project package is com.myapplynx.mytexteditor.common
My library project is properly included in my application project as I can use other classes in the library project from within my application project.
The activity MyTedAdvancedPreference
is found in my library project under com.myapplynx.mytexteditor.common.prefs
package.
In my application project, I have an xml, res/xml/prefs.xml
, where I have defined preferences, including a preference screen to call MyTedAdvancedPreference
as shown below:
<PreferenceScreen android:title="@string/config_cat_advanced" >
<intent android:action="android.intent.action.VIEW"
android:targetPackage="com.myapplynx.mytexteditor.android"
android:targetClass="com.myapplynx.mytexteditor.common.prefs.MyTedAdvancedPreferences"/>
Note that MyTedAdvancedPreferences is included in my application project AndroidManifest.xml as :
<application
.....
<activity android:name="com.myapplynx.mytexteditor.common.prefs.MyTedAdvancedPreference"
android:label="@string/title_settings"
android:theme="@style/MyApplynxTheme" >
</activity>
....
</application>
My application compiles and runs OK. So when I access my settings page and try to access MyTedAdvancedPreference
, I get an ActivityNotFoundException
:
10-25 14:15:52.734: E/AndroidRuntime(19049): FATAL EXCEPTION: main
10-25 14:15:52.734: E/AndroidRuntime(19049): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapplynx.mytexteditor.android/com.myapplynx.mytexteditor.common.prefs.MyTedAdvancedPreferences}; have you declared this activity in your AndroidManifest.xml?
The activity is defined in my applications(com.myapplynx.mytexteditor.android
) AndroidManifest.xml
. What am I doing wrong? Thanks.