[XDA-University] lacoursiere18:
Hey guys need a little guidance..

I am trying to port PA's led notification color picker and options to 4.3 Touchwiz..Verizon MJ9. I believe i pulled everything needed, considering all the smali is one place and all the layout, ids, and xml's as well..I get an error upon clicking the prefrence screen though..Here is the error:

04-06 10:47:49.187 E/AndroidRuntime(7120): FATAL EXCEPTION: main
04-06 10:47:49.187 E/AndroidRuntime(7120): java.lang.NullPointerException
04-06 10:47:49.187 E/AndroidRuntime(7120):	at com.android.settings.notificationlight.ApplicationLightPreference.onBindView(ApplicationLightPreference.java:129)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.preference.Preference.getView(Preference.java:468)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:222)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.AbsListView.obtainView(AbsListView.java:2627)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.ListView.makeAndAddView(ListView.java:1852)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.ListView.fillDown(ListView.java:682)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.ListView.fillFromTop(ListView.java:748)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.ListView.layoutChildren(ListView.java:1653)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.AbsListView.onLayout(AbsListView.java:2447)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1666)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.onLayout(LinearLayout.java:1442)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:349)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.View.layout(View.java:15204)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewGroup.layout(ViewGroup.java:4793)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2263)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2009)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1251)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6379)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.Choreographer.doCallbacks(Choreographer.java:591)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.Choreographer.doFrame(Choreographer.java:561)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.os.Handler.handleCallback(Handler.java:730)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.os.Handler.dispatchMessage(Handler.java:92)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.os.Looper.loop(Looper.java:137)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at android.app.ActivityThread.main(ActivityThread.java:5493)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at java.lang.reflect.Method.invokeNative(Native Method)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at java.lang.reflect.Method.invoke(Method.java:525)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
04-06 10:47:49.187 E/AndroidRuntime(7120):	at dalvik.system.NativeStart.main(Native Method)
04-06 10:47:49.197 I/ActivityManager(3326): Notify an ApplicationCrash
04-06 10:47:49.232 D/ConnectivityService(3326): handleInetConditionHoldEnd: net=1, condition=100, published condition=100
04-06 10:47:49.232 D/ConnectivityService(3326): sendStickyBroadcast: action=android.net.conn.INET_CONDITION_ACTION
04-06 10:47:49.407 D/ConnectivityService(3326): [CheckMp] isMobileOk: not connected ni=NetworkInfo: type: mobile_hipri[LTE], state: UNKNOWN/IDLE, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
04-06 10:47:49.497 I/WindowManager(3326): Screenshot max retries 4 of Token{435f5b10 ActivityRecord{4339d3c8 u0 com.android.settings/.SubSettings}} appWin=Window{42955970 u0 com.android.settings/com.android.settings.SubSettings} drawState=1
04-06 10:47:49.497 W/WindowManager(3326): Screenshot failure taking screenshot for (720x1280) to layer 21020
04-06 10:47:49.502 D/PointerIcon(3326): setHoveringSpenIconStyle1 pointerType: 10001iconType:1 flag:0
04-06 10:47:49.502 D/PointerIcon(3326): setHoveringSpenCustomIcon IconType is same.1
04-06 10:47:49.502 D/CrashAnrDetector(3326): processName: com.android.settings
04-06 10:47:49.502 D/CrashAnrDetector(3326): broadcastEvent : com.android.settings system_app_crash
04-06 10:47:49.502 E/android.os.Debug(3326): !@sDumpstate is still running
04-06 10:47:49.502 V/SmartFaceService - 3rd party pause(3326): onReceive [android.intent.action.ACTIVITY_STATE/com.android.settings/pause]

I believe I have everything in place.. But it seems like i am missing something but not sure what it is pointing too.. Here is the method as well mentioned in the error:

.method protected onBindView(Landroid/view/View;)V
.locals 2
.param p1, "view" # Landroid/view/View;

.prologue
.line 120
invoke-super {p0, p1}, Landroid/preference/DialogPreference;->onBindView(Landroid/view/View;)V

.line 122
const v1, 0x7f0b061b

invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/ImageView;

iput-object v1, p0, Lcom/android/settings/notificationlight/ApplicationLightPreference;->mLightColorView:Landroid/widget/ImageView;

.line 123
const v1, 0x7f0b0619

invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/TextView;

iput-object v1, p0, Lcom/android/settings/notificationlight/ApplicationLightPreference;->mOnValueView:Landroid/widget/TextView;

.line 124
const v1, 0x7f0b061a

invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Landroid/widget/TextView;

iput-object v1, p0, Lcom/android/settings/notificationlight/ApplicationLightPreference;->mOffValueView:Landroid/widget/TextView;

.line 128
const v1, 0x10101e9

invoke-virtual {p1, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/widget/TextView;

.line 129
.local v0, "tView":Landroid/widget/TextView;
const/16 v1, 0x8

invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

.line 131
invoke-direct {p0}, Lcom/android/settings/notificationlight/ApplicationLightPreference;->updatePreferenceViews()V

.line 132
return-void
.end method

I replaced all the id's with the proper ones.. In my SecSettings and my framework-res as well..

Im still learning so go easy on me.. But any pointers would GREATLY be appreciated! Thanks!