[Galaxy S II Android Development] remuntada78:
Hi Goldie, sorry if I insist with my problem with port lockscreen notifications, but i tried and tried, start and restart from the beginning and take it step by step I have always had the same problem

E/AndroidRuntime( 4338): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException

E/AndroidRuntime( 4338): Caused by: java.lang.NullPointerException

E/AndroidRuntime( 4338):	at com.android.settings.AOSPAL.LockscreenNotifications.onCreate(LockscreenNotifications.java:128)

but using hierarchyviewer tool for other things I noticed this

so i made a link to my error

E/AndroidRuntime( 4338): java.lang.RuntimeException: Unable to start activity ComponentInfo{[COLOR="Red"]com.android.settings/com.android.settings.SubSettings[/COLOR]}: java.lang.NullPointerException

in the LockscreenNotifications.smali i added my id of lockscreen_notifications.xml

.method public onCreate(Landroid/os/Bundle;)V
.locals 13
.parameter "savedInstanceState"

.prologue
.line 61
invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V

.line 63
const v9, 0x7f07008e [COLOR="Red"]this is my lockscreen_notifications.xml id[/COLOR]

invoke-virtual {p0, v9}, Lcom/android/settings/AOSPAL/LockscreenNotifications;->addPreferencesFromResource(I)V

.line 64
invoke-virtual {p0}, Lcom/android/settings/AOSPAL/LockscreenNotifications;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

move-result-object v8

.line 65
.local v8, prefs:Landroid/preference/PreferenceScreen;
invoke-virtual {p0}, Lcom/android/settings/AOSPAL/LockscreenNotifications;->getActivity()Landroid/app/Activity;

move-result-object v9

invoke-virtual {v9}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

I'll explain you what I've done with ported xml

i ported lockscreen_notifications.xml without changes

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/lockscreen_notifications"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory android:title="@string/general" android:key="category_general">
<CheckBoxPreference android:title="@string/lockscreen_notifications" android:key="lockscreen_notifications" android:summary="@string/lockscreen_notifications_summary" />
<CheckBoxPreference android:title="@string/pocket_mode" android:key="pocket_mode" android:summary="@string/pocket_mode_summary" />
<CheckBoxPreference android:title="@string/show_always" android:key="show_always" android:summary="@string/show_always_summary" />
<CheckBoxPreference android:title="@string/wake_on_notification" android:key="wake_on_notification" android:summary="@string/wake_on_notification_summary" />
<CheckBoxPreference android:title="@string/hide_low_priority" android:key="hide_low_priority" android:summary="@string/hide_low_priority_summary" />
<CheckBoxPreference android:title="@string/hide_non_clearable" android:key="hide_non_clearable" android:summary="@string/hide_non_clearable_summary" />
<CheckBoxPreference android:title="@string/dismiss_all" android:key="dismiss_all" android:summary="@string/dismiss_all_summary" />
<com.android.settings.AOSPAL.AppMultiSelectListPreference android:persistent="false" android:title="@string/excluded_apps_title" android:key="excluded_apps" android:summary="@string/excluded_apps_summary" android:dependency="lockscreen_notifications" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/layout">
<SeekBarPreference android:max="100" android:title="@string/offset_top" android:key="offset_top" android:defaultValue="30" />
<com.android.settings.AOSPAL.NumberPickerPreference android:title="@string/notifications_height" android:key="notifications_height" android:summary="@string/notifications_height_summary" android:dialogMessage="@string/notifications_height" />
<com.loser.colorpicker.ColorPickerPreference android:title="@string/notification_color" android:key="notification_color" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/privacy">
<CheckBoxPreference android:title="@string/privacy_mode" android:key="privacy_mode" android:summary="@string/privacy_mode_summary" />
<CheckBoxPreference android:title="@string/expanded_view" android:key="expanded_view" android:summary="@string/expanded_view_summary" />
<CheckBoxPreference android:title="@string/force_expanded_view" android:key="force_expanded_view" android:summary="@string/force_expanded_view_summary" />
</PreferenceCategory>
</PreferenceScreen>

and in my custom_mod.xml i added a line

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings.custommod">
[COLOR="Red"] <PreferenceScreen android:title="@string/lockscreen_notifications" android:fragment="com.android.settings.AOSPAL.LockscreenNotifications" />[/COLOR]
<PreferenceCategory android:title="@string/animations">
<PreferenceScreen android:icon="@drawable/ic_list" android:title="@string/listview_animation_title" android:key="listview_animation_settings" android:fragment="com.android.settings.adi.ListViewSettings" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/text_options" android:key="text_options">
<PreferenceScreen android:icon="@drawable/ic_textcolor" android:title="@string/text_color_title" android:summary="@string/text_color_summary">
<CheckBoxPreference android:title="@string/enable_text_options" android:key="checkbox_preference" />
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/title_text_color_title" android:key="text_color" android:summary="@string/title_text_color_summary" android:defaultValue="0xffffffff" alphaSlider="true" />
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/summary_text_color_title" android:key="summary_text_color" android:summary="@string/summary_text_color_summary" android:defaultValue="0xffffffff" alphaSlider="true" />
</PreferenceScreen>
</PreferenceCategory>

could this be the cause of the error?

thanks in advance