The logat says the NPE is located at 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.mobilevideoeditor.moved.EditorView.onClick(EditorView.java:81), which would be lv.setAdapter(new ArrayAdapter<String>(this, R.layout.specialeffectsview, specialEffects));
Here is the output: 08-03 00:07:57.454: ERROR/AndroidRuntime(8898): Uncaught handler: thread main exiting due to uncaught exception 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): java.lang.NullPointerException 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.mobilevideoeditor.moved.EditorView.onClick(EditorView.java:81) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.View.performClick(View.java:2364) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.View.onTouchEvent(View.java:4179) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.View.dispatchTouchEvent(View.java:3709) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.app.Activity.dispatchTouchEvent(Activity.java:2068) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.view.ViewRoot.handleMessage(ViewRoot.java:1724) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.os.Handler.dispatchMessage(Handler.java:99) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.os.Looper.loop(Looper.java:123) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at android.app.ActivityThread.main(ActivityThread.java:4603) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at java.lang.reflect.Method.invokeNative(Native Method) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at java.lang.reflect.Method.invoke(Method.java:521) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 08-03 00:07:57.464: ERROR/AndroidRuntime(8898): at dalvik.system.NativeStart.main(Native Method) On Mon, Aug 2, 2010 at 11:00 PM, Justin Anderson <janderson....@gmail.com>wrote: > Where exactly does the NullPointerException occur? If you aren't sure you > can find this by looking for a "caused by" line in the logcat information > after your app crashes. > > > ---------------------------------------------------------------------- > There are only 10 types of people in the world... > Those who know binary and those who don't. > ---------------------------------------------------------------------- > > > On Mon, Aug 2, 2010 at 3:56 PM, Victoria <victoriasarabu...@gmail.com>wrote: > >> Hi there, >> >> I am trying to set up a ViewFlipper that changes a SlidingDrawers >> content each time a button is pressed. So far every view I set up >> worked fine, but now I am trying to create a ListView (including >> single_choice_mode) within a child view of the ViewFlipper, but my >> attempt only let to a NullPointerException. As I only discovered >> ViewFlipper today, I am not yet familiar with it and may not have >> understood it completely...if someone could give me a hand and help me >> find out what I have done wrong, that would be great. >> >> Thank you in advance. >> >> Here is what I have done: >> >> The code for the onClick event of the ImageButtons: >> >> public void onClick(View v){ >> if (v == btnExposure){ >> >> mFlipper.setDisplayedChild(0); >> >> } >> else if (v == btnProperties){ >> mFlipper.setDisplayedChild(1); >> } >> >> else if (v == btnSpecialEffects){ >> mFlipper.setDisplayedChild(2); >> String[] specialEffects = >> getResources().getStringArray(R.array.special_effects_array); >> lv.setAdapter(new ArrayAdapter<String>(this, >> R.layout.specialeffectsview, specialEffects)); >> lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE); >> } >> >> } >> The XML code of the ViewFlipper within my main xml file: >> >> <ViewFlipper >> android:layout_width="wrap_content" >> android:layout_height="wrap_content" >> android:id="@+id/flipper" >> android:layout_toRightOf="@id/button_exposure"> >> <include android:id="@+id/view_exposure" layout="@layout/ >> exposureview" /> >> <include android:id="@+id/view_properties" layout="@layout/ >> propertiesview" /> >> <include android:id="@+id/view_special_effects" layout="@layout/ >> specialeffectsview"/> >> </ViewFlipper> >> The string array within my strings.xml: >> >> <string-array name="special_effects_array"> >> <item>None</item> >> <item>Greyscale</item> >> <item>Sepia</item> >> <item>Negative</item> >> <item>Solarize</item> >> <item>Polarize</item> >> </string-array> >> >> And finally the specialeffectsview.xml (the layout file for the >> ListView): >> >> <?xml version="1.0" encoding="utf-8"?> >> <LinearLayout android:id="@+id/view_special_effects_list" >> android:layout_width="fill_parent" >> android:layout_height="fill_parent" >> xmlns:android="http://schemas.android.com/apk/res/android"> >> <ListView android:id="@+id/special_effects_list" >> android:layout_height="wrap_content" >> android:layout_width="fill_parent"></ListView> >> </LinearLayout> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Beginners" group. >> >> ATTENTION: Android-Beginners will be permanently disabled on August 9 >> 2010. For more information about this change, please read [ >> http://goo.gl/xkfl] or visit the Group home page. >> >> Try asking and tagging your question on Stack Overflow at >> http://stackoverflow.com/questions/tagged/android >> >> To unsubscribe from this group, send email to >> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-beginners?hl=en >> > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. > For more information about this change, please read [http://goo.gl/xkfl] > or visit the Group home page. > > Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en