Nov 6 | 9:50 AM |
Mark M. | has entered the room |
Nov 6 | 9:55 AM |
Mark M. | turned on guest access |
bsr | has entered the room |
bsr |
Good morning Mark
|
Nov 6 | 10:00 AM |
Mark M. |
howdy, bsr!
|
Nov 6 | 10:00 AM |
Mark M. |
how can I help you today?
|
bsr |
I was playing with Dynamic fragments, and Rotation Fragment demo crashes
|
bsr |
View paste
|
bsr |
I was mainly looking to see how you retain the view on rotation
|
Mark M. |
I have nothing to do with com.android.htccontacts
|
bsr |
ok, I use htc device
|
Mark M. |
try running the sample on an emulator
|
bsr |
ok, anyway, I could capure the state of fragment in a private variable, but the view lose its contents.
|
bsr |
I saw a blog post just now about this
|
bsr | |
bsr |
do you have an example in the book how best I can re-initialize view after config change
|
bsr |
in case of dynamic fragments
|
Mark M. |
I am not a big fan of the technique used in that blog post, except if there is no alternative (e.g., a WebView)
|
bsr |
oh. What should be a better approach
|
Mark M. |
hold onto the data, not the views
|
bsr |
ok, then reinitialize in onCreateView?
|
Mark M. |
that's a likely spot
|
Nov 6 | 10:05 AM |
bsr |
One more quick qn,
|
bsr |
I was following the tutorial on REST client through Intent + ResultReceiver
|
bsr | |
bsr |
The author initialize mReceiver in fragment constructor
|
bsr |
View paste
|
bsr |
I wonder the rational, rather than doing it in onCreate
|
Mark M. |
you would have to ask the author
|
bsr |
Do you think, it will be properly initialized if I do it in onCreate
|
bsr |
I don't fully know the lifecycle
|
Mark M. |
presumably, yes
|
bsr |
:-) .. that's it.. thanks a lot
|
Mark M. |
you are very welcome
|
bsr |
have a great day.
|
bsr | has left the room |
Mark M. |
you too!
|
Nov 6 | 10:15 AM |
soli | has entered the room |
Mark M. |
howdy, soli!
|
Mark M. |
how can I help you today?
|
soli |
Hi mark!
|
soli |
View paste
|
soli |
View paste
|
Mark M. |
well, I do not see that you have a choice except to create a new Cursor and Adapter
|
Mark M. |
hence, whether it is efficient or not does not matter -- all that matters is whether it is fast enough for your needs
|
soli |
can i create them elsewhere? like on new instance ?
|
soli |
oh ok
|
Mark M. |
I fail to see how that will help
|
soli |
ok, well thanks:)
|
Mark M. |
now, you really should be doing that database query on a background thread
|
Mark M. |
such as via an AsyncTask
|
Mark M. |
you will be getting some nasty messages from StrictMode if you have that enabled
|
Nov 6 | 10:20 AM |
soli |
just haven't got around to it
|
soli |
:)
|
Mark M. |
oh, OK
|
soli |
oh another thing i wanted to ask is if you are available for questions through emails(with a fee of course)
|
Mark M. |
feel free to ask other questions, if you have them -- the chat room is not very crowded right now... :-)
|
soli |
yeah hehe:)
|
Mark M. |
yes, I do a bit of online question-and-answer consulting via email, but not that much
|
Mark M. |
feel free to contact me off-chat at mmurphy@commonsware.com
|
Mark M. |
to discuss what you need
|
soli |
ok great, i will. It would help me a lot. Have a good day!
|
Mark M. |
you too!
|
Nov 6 | 10:35 AM |
bsr | has entered the room |
bsr |
Mark, one more quick qn
|
Mark M. |
hello again!
|
bsr |
Can I mix static and dynamic fragments
|
bsr |
View paste
(5 more lines)
|
bsr |
I dynamically add the fragment_list_container
|
bsr |
but, the details fragment is static (through xml)
|
bsr |
is it a possibility
|
bsr |
or should it be dynamic too
|
Mark M. |
what do you mean by "dynamically add the fragment_list_container"?
|
bsr |
through FragmentManager
|
bsr |
at runtime
|
Mark M. |
are you saying that the layout you have pasted above is itself a fragment, containing another fragment?
|
Mark M. |
because FragmentManager works with Fragments, not layouts
|
bsr |
no, this is main.xml
|
bsr |
View paste
|
bsr |
this is my activity
|
Nov 6 | 10:40 AM |
Mark M. |
I have never tried that
|
bsr |
sorry, I am bit lousy with terminology
|
Mark M. |
I think that you will lose track of your static fragment
|
bsr |
ok, that may be the problem as it is not dispaying
|
Mark M. |
and that the ListFragment will float over top of the static fragment on the Z axis
|
soli | has left the room |
Mark M. |
which is probably not what you want
|
bsr |
oh ok
|
Mark M. |
and AFAIK you cannot use a FragmentTransaction to manipulate a static fragment (e.g., replace() or remove() it)
|
bsr |
ok
|
bsr |
I may better use one or other (static / dynamic) and not to mix then
|
bsr |
Thanks Mark. THat's it
|
Mark M. |
that would be my recommendation
|
bsr |
catch u later, have a great day
|
bsr | has left the room |
Nov 6 | 11:00 AM |
Mark M. | turned off guest access |