I have some problems with my XML code i hope you can help me with.
I have this class in this package:
package com.example.myview
public class CustomDialog extends DialogPreference {
public CustomDialog(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public CustomDialog(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
}
And then i have this preference xml file:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<com.example.myview.CustomDialog
android:dialogMessage="Are you sure you wish delete you account"
android:key="deleteAccountPreference"
android:negativeButtonText="Cancel"
android:positiveButtonText="Okay"
android:summary="@string/preferences_deleteaccount_summary"
android:title="@string/preferences_deleteaccount_title" />
</PreferenceScreen>
And when i run the code i get this error:
03-16 17:03:18.032: E/AndroidRuntime(20224): android.view.InflateException: Binary XML file line #4: Error inflating class com.example.myview.CustomDialog
...
03-16 17:03:18.032: E/AndroidRuntime(20224): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.myview.CustomDialog" on path: .
To summarize my problem, i wanna know how to change the path the xml file is looking at, or figure out why it can't inflate my custom view.
Thanks in advance :)