質問

I have the code downloaded from site: http://blog.350nice.com/wp/archives/240

But on the line:

<com.threefiftynice.android.preference.ListPreferenceMultiSelect 

Is error code:

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'checkAll' in package 
     'com.threefiftynice.android'
    - error: No resource identifier found for attribute 'separator' in package 
     'com.threefiftynice.android'

This is XML with error:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:key="prefKey"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:threefiftyprefs="http://schemas.android.com/apk/res/com.threefiftynice.android">  
    <com.threefiftynice.android.preference.ListPreferenceMultiSelect 
        threefiftyprefs:checkAll="check" threefiftyprefs:separator="|"
        android:defaultValue="#ALL#"
        android:key="key"
        android:title="Image folders to monitor" android:dialogTitle="Image folders to monitor"
        android:summary="Specify which folders should be monitored for images"
        android:entries="@array/typeOfPoints"
        android:entryValues="@array/typeOfPointsID"/>
</PreferenceScreen>

I know xmlns and the path to ListPreferenceMultiselect ist bad - but I tried a lot of possible paths and problem was with all of them (this is the original path from the site with original packages). This is my structure of the code

: enter image description here

How should I set the path to make it work? Thank you very much.

EDIT: After chanded it to xmlns:threefiftyprefs="schemas.android.com/apk/res-auto" it does not write error in xml but it throws error on run:

Uncaught handler: thread main exiting due to uncaught exception
java.lang.RuntimeException: Unable to start activity ComponentInfo{goandknow.proximityalerts/goandknow.proximityalerts.EditPreferences}: android.view.InflateException: Binary XML file line #24: Error inflating class com.threefiftynice.android.preference.ListPreferenceMultiSelect at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284) at android.app.ActivityThread.access$1800(ActivityThread.java:112)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3948) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class com.threefiftynice.android.preference.ListPreferenceMultiSelect at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441) at android.preference.GenericInflater.rInflate(GenericInflater.java:481) at android.preference.GenericInflater.rInflate(GenericInflater.java:493) at android.preference.GenericInflater.inflate(GenericInflater.java:326)
at android.preference.GenericInflater.inflate(GenericInflater.java:263)
at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:250) at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:253) at goandknow.proximityalerts.EditPreferences.onCreate(EditPreferences.java:24) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231) ... 11 more

This is line 24:

com.threefiftynice.android.preference.ListPreferenceMultiSelect

役に立ちましたか?

解決

change the line

xmlns:threefiftyprefs="http://schemas.android.com/apk/res/com.threefiftynice.android"

to

xmlns:threefiftyprefs="http://schemas.android.com/apk/res-auto"

他のヒント

This is how it should be:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:key="prefKey"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:threefiftyprefs="schemas.android.com/apk/res-auto">  
    <goandknow.models.ListPreferenceMultiSelect 
    threefiftyprefs:checkAll="check" threefiftyprefs:separator="|"
    android:defaultValue="#ALL#"
    android:key="key"
    android:title="Image folders to monitor" android:dialogTitle="Image folders"
    android:summary="Specify which folders should be monitored for images"
    android:entries="@array/typeOfPoints"
    android:entryValues="@array/typeOfPointsID"/>
</PreferenceScreen>

Important:

xmlns:threefiftyprefs="schemas.android.com/apk/res-auto" goandknow.models.ListPreferenceMultiSelect Thanks to Sankar V.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top