Update, just found a mistake within the ViewStub declaration as I forgot to
specify a layout, here is the updated code because the error is still there
:(( If someone knows what I am doing wrong please help me because after
finding out that I forgot the layout *I thought it would work *but
apparently it still doesn't

<ViewStub
       android:id="@+id/stub_exposure"
       android:inflatedId="@+id/stub_exposure_view"

       android:layout="@layout/exposureview"

       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:background="#77000000">
</ViewStub>

On Sun, Aug 1, 2010 at 1:11 AM, kivy <[email protected]> wrote:

> Hi there,
>
> I just ran into a problem, while trying to populate a ViewStub by
> tapping an ImageButton within a SlidingDrawer (the ViewStub should
> also be part of the drawer), but all I get is a Force Close Error due
> to a Null Pointer Exception. As I am using ViewStubs for the first
> time I am not sure, what may have caused the exception. If someone
> could help me out with this issue, this would be fantastic.
>
> Thank you in advance.
>
> This is the code I use to inflate the ViewStub:
>
> btnExposure.setOnClickListener(new OnClickListener()
>        {
>            @Override
>            public void onClick(View v) {
>                importStub = ((ViewStub)
> findViewById(R.id.stub_exposure)).inflate();
>
>            }
>        });
> This is part of the Sliding Drawer xml file containing the ViewStub:
>
> <ViewStub
>        android:id="@+id/stub_exposure"
>        android:inflatedId="@+id/exposureview"
>        android:layout_width="fill_parent"
>        android:layout_height="fill_parent"
>        android:background="#77000000">
> </ViewStub>
> This is the exposureview.xml (the inflatedID):
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/
> android"
>    android:layout_width="fill_parent"
>    android:layout_height="fill_parent">
>    <SeekBar
>        android:layout_width="wrap_content"
>        android:layout_height="wrap_content"
>        android:thumb="@drawable/seek_thumb"
>        android:progress="50"
>        android:max="100">
>    </SeekBar>
>
> </RelativeLayout>
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
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

Reply via email to