I'm trying to create a settings for my Daydream
and according to the documentation, I need to create a xml file, like this:
<dream xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.example.app/.MyDreamSettingsActivity" />
However, my Activity
is in a library project (called com.project.base) and I keep getting this error in Logcat
when clicking on the setting button:
11-16 23:01:29.331: E/AndroidRuntime(28908): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.project.base/com.project.base.SettingsDayDream}; have you declared this activity in your AndroidManifest.xml?
I have my xml file setup like this:
<dream xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.project.base/.SettingsDayDream" />
but I've tried all variation, such as com.project.base/com.project.base.SettingsDayDream
and just com.project.base.SettingsDayDream
, but nothing seems to work.
I've declared the activity in the AndroidManifest.xml
like this:
<activity android:name="com.project.base.SettingsDayDream" android:configChanges="keyboardHidden|orientation" />
as well as the service:
<service android:name="com.project.base.DayDream" android:exported="true" android:icon="@drawable/icon" android:label="@string/app_name">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.service.dream" android:resource="@xml/daydream" />
</service>
The problem is in your daydream.xml
. The format for the android:settingsActivity
is current.app.package/com.project.base.SettingsActivity
So current.app.package
, before the /
, needs to be your current app, not the library project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With