[android-developers] Re: Not able to place the custom view to dialog

2010-05-28 Thread Jeruliu
Thanks, just solved myself, i don't actually need to use that
SeekBarPreference.

For instead, i should just define the standard component SeekBar in my
custom dialog. It works that way.

On May 28, 7:49 pm, Paweł Zięba  wrote:
> Try this
>
> LayoutInflater inflater = LayoutInflater.from(context);
> View view = inflater.inflate(R.layout.brightness, null);
> setView(view);
>
> --
> Paweł Zięba
> dziobas.blogspot.com
>
> On 28 Maj, 02:47, Jeruliu  wrote:
>
> > I'm suffering from this for a week, i was trying to use the famous
> > SeekBarPreference in a dialog 
> > -http://android.hlidskialf.com/blog/code/android-seekbar-preference
>
> > I copied the class from above link into my project.
> > Then created the xml as brightness.xml:
>
> > 
> > http://schemas.android.com/apk/res/
> > android"
> >              android:id="@+id/layout_root"
> >              android:orientation="horizontal"
> >              android:layout_width="fill_parent"
> >              android:layout_height="fill_parent"
> >              android:padding="10dp"
> >              >
> >         >                android:key="brightness"
> >        android:title="Brightness"
> >        android:summary="Adjust your android Brightness"
> >        android:dialogMessage="Brightness"
> >        android:defaultValue="120"
> >        android:text=""
> >        android:max="255"
> >        />
> > 
>
> > Finally I try to integrate it as custom dialog:
> > Dialog dialog = new Dialog(mContext);
>
> > dialog.setContentView(R.layout.brightness);
> > dialog.setTitle("Custom Dialog");
> > dialog.show();
>
> > But always getting error: "Error inflating class
> > java.lang.reflect.Constructor" at this line
>
> > "
> > Root cause: ClassCastException on SeekBarPreference
>
> > Can anyone point out why? thanks a million
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Not able to place the custom view to dialog

2010-05-28 Thread Paweł Zięba
Try this

LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.brightness, null);
setView(view);


--
Paweł Zięba
dziobas.blogspot.com


On 28 Maj, 02:47, Jeruliu  wrote:
> I'm suffering from this for a week, i was trying to use the famous
> SeekBarPreference in a dialog 
> -http://android.hlidskialf.com/blog/code/android-seekbar-preference
>
> I copied the class from above link into my project.
> Then created the xml as brightness.xml:
>
> 
> http://schemas.android.com/apk/res/
> android"
>              android:id="@+id/layout_root"
>              android:orientation="horizontal"
>              android:layout_width="fill_parent"
>              android:layout_height="fill_parent"
>              android:padding="10dp"
>              >
>                        android:key="brightness"
>        android:title="Brightness"
>        android:summary="Adjust your android Brightness"
>        android:dialogMessage="Brightness"
>        android:defaultValue="120"
>        android:text=""
>        android:max="255"
>        />
> 
>
> Finally I try to integrate it as custom dialog:
> Dialog dialog = new Dialog(mContext);
>
> dialog.setContentView(R.layout.brightness);
> dialog.setTitle("Custom Dialog");
> dialog.show();
>
> But always getting error: "Error inflating class
> java.lang.reflect.Constructor" at this line
>
> "
> Root cause: ClassCastException on SeekBarPreference
>
> Can anyone point out why? thanks a million

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en