NullPointerException error when polling down the preset url list spinner 1


There was a bug in RTSPPlayer, that is when you poll down the preset RTSP stream source  list spinner, the APP will crash with an NullPointerException. Today, I finally have it fixed.

Error message detail:

[code]

04-29 14:47:07.610: W/dalvikvm(8068): threadid=1: thread exiting with uncaught exception (group=0x4001d560)
04-29 14:47:07.690: E/AndroidRuntime(8068): FATAL EXCEPTION: main
04-29 14:47:07.690: E/AndroidRuntime(8068): java.lang.NullPointerException
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ArrayAdapter.getDropDownView(ArrayAdapter.java:376)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.Spinner$DropDownAdapter.getDropDownView(Spinner.java:336)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.Spinner$DropDownAdapter.getView(Spinner.java:332)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.AbsListView.obtainView(AbsListView.java:1533)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ListView.makeAndAddView(ListView.java:1793)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ListView.fillDown(ListView.java:718)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ListView.fillGap(ListView.java:689)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4142)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.AbsListView.onTouchEvent(AbsListView.java:2523)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.widget.ListView.onTouchEvent(ListView.java:3696)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.View.dispatchTouchEvent(View.java:3938)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1737)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1151)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.app.Dialog.dispatchTouchEvent(Dialog.java:642)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1721)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2217)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1888)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.os.Looper.loop(Looper.java:123)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at java.lang.reflect.Method.invokeNative(Native Method)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at java.lang.reflect.Method.invoke(Method.java:507)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
04-29 14:47:07.690: E/AndroidRuntime(8068):     at dalvik.system.NativeStart.main(Native Method)

[/code]

Here is my solution for this:


Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “NullPointerException error when polling down the preset url list spinner