[Java for Android App Development] Wooaarr:
Hello there,

i want to achive a simple thing. Removing an entry in the "SpareParts" app.

This is the xml

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/device_info_title">
<PreferenceScreen android:title="@string/title_battery_history" android:key="battery_history_settings" android:summary="@string/summary_battery_history">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.battery_history.BatteryHistory" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/title_battery_information" android:key="battery_information_settings" android:summary="@string/summary_battery_information">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.BatteryInfo" />
</PreferenceScreen>
<PreferenceScreen android:title="@string/title_usage_statistics" android:key="usage_statistics_settings" android:summary="@string/summary_usage_statistics">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.UsageStats" />
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="@string/general_title">
<ListPreference android:entries="@array/entries_animations" android:title="@string/title_window_animations" android:key="window_animations" android:summary="@string/summary_window_animations" android:dialogTitle="@string/dialog_title_window_animations" android:entryValues="@array/entryvalues_animations" />
<ListPreference android:entries="@array/entries_animations" android:title="@string/title_transition_animations" android:key="transition_animations" android:summary="@string/summary_transition_animations" android:dialogTitle="@string/dialog_title_transition_animations" android:entryValues="@array/entryvalues_animations" />
<CheckBoxPreference android:title="@string/title_fancy_ime_animations" android:key="fancy_ime_animations" android:summaryOn="@string/summary_on_fancy_ime_animations" android:summaryOff="@string/summary_off_fancy_ime_animations" />
<ListPreference android:entries="@array/entries_font_size" android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" android:entryValues="@array/entryvalues_font_size" />
<CheckBoxPreference android:title="@string/title_haptic_feedback" android:key="haptic_feedback" android:summaryOn="@string/summary_on_haptic_feedback" android:summaryOff="@string/summary_off_haptic_feedback" />
<CheckBoxPreference android:title="@string/compatibility_mode_title" android:key="compatibility_mode" android:summaryOn="@string/compatibility_mode_summary_on" android:summaryOff="@string/compatibility_mode_summary_off" />
</PreferenceCategory>
[b][SIZE="4"]<PreferenceCategory android:enabled="false" android:title="@string/disabled">
<ListPreference android:entries="@array/entries_end_button" android:title="@string/title_end_button" android:key="end_button" android:summary="@string/summary_end_button" android:dialogTitle="@string/dialog_title_end_button" android:entryValues="@array/entryvalues_end_button" />
</PreferenceCategory>[/SIZE][/b]
</PreferenceScreen>

The preference i want to remove is in bold. Now just deleting it, obviously will cause the app to fc. I have to remove the preference in the smali code.

Unfortunatly i have no idea, where and how exactly implement the right code to remove the preference.

An example on how to remove a preference would be (Just an example, thats not what i want to remove):

invoke-virtual {p0}, Lcom/android/settings/WirelessSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v12
const-string v13, "toggle_wifi"
invoke-virtual {p0, v13}, Lcom/android/settings/WirelessSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v13
invoke-virtual {v12, v13}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

If anyone could help me out on where to implement the appropiate code i would be glad to learn about this.

I attached the smali code.

Thanks in advance