Re: [android-developers] Re: Using ListPreference view in a non preference activity/dialog

2011-03-21 Thread Kostya Vasilyev

21.03.2011 20:05, Wall-E пишет:

03-21 16:12:24.395: ERROR/AndroidRuntime(1472): Caused by:
java.lang.RuntimeException: Your content must have a ListView whose id
attribute is 'android.R.id.list'


PreferenceActivity uses a list view to display its content. If you wish 
use your own layout for the activity, include a ListView with 
id="@android:id/list".



So assuming that I should be able to what I described above, my
question should be how to inflate the PreferenceActivity using my
layout created for the dialog but also sneaking in Preference views
such as ListPreference in that same layout.


Start with your own views, then a list view that would be used for 
preference views.



I'm just now thinking I should create a Preference Screen layout and
include all the views I had in my dialog layout.


You can integrate your own views by using Preference, with or without 
subclassing, by using "android:layout" attribute in XML or 
setLayoutResource in code.


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

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


Re: [android-developers] Re: Using ListPreference view in a non preference activity/dialog

2011-03-21 Thread TreKing
On Mon, Mar 21, 2011 at 12:05 PM, Wall-E  wrote:

> I'm just now thinking I should create a Preference Screen layout
> and include all the views I had in my dialog layout.
>

Seems like the easiest and most straightforward thing to do.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
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: Using ListPreference view in a non preference activity/dialog

2011-03-21 Thread Wall-E
Well I first initially had dialog and created a layout to use in that
dialog to set certain preferences/values.  So I tried to
inflate(setContentView(dialogLayout)) that same layout in a
PreferenceActivity I created but then was getting this error:

03-21 16:12:24.395: ERROR/AndroidRuntime(1472): Caused by:
java.lang.RuntimeException: Your content must have a ListView whose id
attribute is 'android.R.id.list'

So assuming that I should be able to what I described above, my
question should be how to inflate the PreferenceActivity using my
layout created for the dialog but also sneaking in Preference views
such as ListPreference in that same layout.

I'm just now thinking I should create a Preference Screen layout and
include all the views I had in my dialog layout.

Any other suggestions?



On Mar 21, 12:36 pm, TreKing  wrote:
> On Mon, Mar 21, 2011 at 11:04 AM, Wall-E  wrote:
> > I would like to use certain views associated with the PreferenceActivty
> > such as the ListPreference in my Activity or Dialog but I don't want my
> > activity to be a PreferenceActivty.
>
> Why not?
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

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