Aug 3 | 9:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Aug 3 | 10:00 AM |
Paul | has entered the room |
Mark M. |
howdy, Paul!
|
Aug 3 | 10:05 AM |
Mark M. |
how can I help you?
|
Paul |
Hi Mark.... Im a first time chatter
|
Paul |
I have a problem in trying to refresh a ListView
after changes Preferences in a Menu
|
Mark M. |
what sort of adapter are you using? and where is
the data for that adapter coming from?
|
Paul |
The challenge is getting the system to return back
to the calling function so that I can get issue the adapter invalidate
commands
|
Paul |
(I suppose this is going to become a cut and paste
situation)
|
Paul |
Adapter is a database cursor and the data comes
from sqlite3
|
Paul |
The function basically allows the user to change a
view filter
|
Mark M. |
"view filter"?
|
Paul |
so that they can see all items or only a subset
|
Mark M. |
are you changing the database query in response to
the preference change?
|
Paul |
Yes, see all records, see all completed records
|
Paul |
Yes, thats it
|
Mark M. |
easiest thing to do is to associate a new adapter
with the ListView, then
|
Mark M. |
you'll see where I do that in Android Programming
Tutorials, Tutorial #12
|
Paul |
OK... I will have a look at chapter 12
|
Mark M. |
there, I have a PreferenceActivity that lets the
user choose a sort order
|
Mark M. |
I use a preference-change listener to find out
when they modify the setting
|
Aug 3 | 10:10 AM |
Paul |
I really like your books... they really helped and
I dont think there is any other resource like them available..
|
Paul |
Thank you so much for your help.
|
Mark M. |
there are lots of other books, though the whole
set you get for the Warescription is tough to beat
|
Mark M. |
happy to help!
|
Paul |
cya
|
Paul | has left the room |
Marc T. | has entered the room |
Mark M. |
howdy, Marc T.!
|
Marc T. |
hi mark
|
Marc T. |
hello..no one's here yet
|
Mark M. |
actually, Paul just left
|
Mark M. |
how can I help you?
|
Marc T. |
ah..ok..just one question, very basic..i use it
most of the time but i dont really understand it
|
Marc T. |
basically the difference between android:gravity
and android:layout_gravity
|
Mark M. |
ah
|
Mark M. |
android:gravity controls the placement of things
inside a widget
|
Aug 3 | 10:15 AM |
Mark M. |
for example, where text goes in a multi-line
EditText
|
Aug 3 | 10:15 AM |
Mark M. |
android:layout_gravity is an instruction to the
widget's container saying where the widget would like to be placed
within that container
|
Mark M. |
layout_gravity is mostly used with LinearLayout --
you have better placement options with RelativeLayout, for example
|
Marc T. |
ah, hmm, so lets say i have a linear layout with
gravity=center and inside i have a textview with layout_gravity=top
|
Marc T. |
which one takes effect?
|
Mark M. |
beats me
|
Mark M. |
Personally, I'd try to avoid situations like that
|
Marc T. |
normally, where would you suggest to put the
layout, on the container or on the widget itself?
|
Mark M. |
"to put the layout"?
|
Marc T. |
i mean, would you put gravity on linear layout, or
put layout_gravity on the widget inside the linear layout
|
Mark M. |
I tend to use RelativeLayout
|
Mark M. |
of your two, though, I would probably go with
layout_gravity on the widget
|
Marc T. |
alright..
|
Aug 3 | 10:20 AM |
Marc T. |
btw, i missed your visit here in singapore..did
you do any android-related session?
|
Mark M. |
CodeAndroid hosted a "chillout session" sort of
meetup on Monday
|
Marc T. |
oh..right..tsk tsk..missed that one
|
Mark M. |
I'll be in the KL area in a couple of weeks, but I
don't know if there is an Android group there
|
Marc T. |
i think there's a CodeAndroid malaysia
|
Marc T. |
you can contact zi yong as well
|
Aug 3 | 10:25 AM |
Marc T. |
any plans going to the philippines? the GTUG
there is quite active and can help organize
|
Mark M. |
I go where the training takes me, and I have had
no training requests from the Philippines
|
Marc T. |
ah..i see
|
Aug 3 | 10:30 AM |
Mark M. |
I have sent an email to codeandroid.my to see if
there is anything I can do to help them while I am in Petaling Jaya
|
Marc T. |
cool..
|
Aug 3 | 10:55 AM |
Mark M. |
the chat period is coming to a close -- any
questions?
|
Marc T. |
no more questions..just waiting for others to come
in
|
Marc T. |
thanks mark
|
Mark M. |
yeah, well, these chats sometimes draw a crowd,
and sometimes they do not
|
Mark M. |
have a pleasant day (or night, in your case)!
|
Marc T. |
yeah..till the next campfire..thanks again
|
Marc T. | has left the room |
Mark M. | turned off guest access |