Hi I am struggling trying to render to custom widget as part of ViewFlipper. when I try to access my widget from the layout file, it gives me a null pointer exception. However putting them all into the java code is not very clean. I am wondering if someone can share few example on how render the ViewFlipper that would flip between two FrameLayout both identitcal containing a custom widget .
Also, even with the ViewFlipper, I am unable to access the ViewFlipper object from resource file. It gives me a null pointer exception. Two frame layouts stored a resource files as frame1 and frame2. all the viewFlipper does is to flip between two views. //main.xml file <?xml version=*"1.0"* encoding=*"utf-8"*?> <LinearLayout xmlns:android=*"http://schemas.android.com/apk/res/android" * android:layout_width=*"fill_parent" * android:layout_height=*"fill_parent"* > <ViewFlipper android:id=*"@+id/flipper" * android:layout_width=*"fill_parent" * android:layout_height=*"fill_parent"* android:layout_marginBottom=*"20dp"*> <include android:id=*"@+id/first"* layout=*"@layout/first_view"* /> <include android:id=*"@+id/second"* layout=*"@layout/second_view"* /> </ViewFlipper> </LinearLayout> //code... setContentView(R.layout.*main*); ViewFlipper *vp* = (ViewFlipper)this.findViewById(R.id.flipper); /the above gives me error..first view and second view contains custom widget. //first view.. <?xml version=*"1.0"* encoding=*"utf-8"*?> <FrameLayout xmlns:android=*"http://schemas.android.com/apk/res/android" * android:layout_width=*"match_parent" * android:layout_height=*"match_parent" * android:id=*"@+id/main_layout" * > <Button android:id=*"@+id/Button01"* android:layout_width=*"wrap_content"* android:layout_height=*"wrap_content"* android:paddingBottom=*"5dp"*> </Button> </FrameLayout> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

