Friday, May 28, 2010

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

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 <pawzi...@gmail.com> 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 <jeru....@gmail.com> 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:
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <LinearLayout xmlns:android="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"
> >              >
> >        <com.yoomap.anymode.SeekBarPreference
> >                android:key="brightness"
> >        android:title="Brightness"
> >        android:summary="Adjust your android Brightness"
> >        android:dialogMessage="Brightness"
> >        android:defaultValue="120"
> >        android:text=""
> >        android:max="255"
> >        />
> > </LinearLayout>
>
> > 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
>
> > "<com.yoomap.anymode.SeekBarPreference" in the xml
>
> > 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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment