Feb 1 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Steve S. | has entered the room |
Mark M. |
hello, Steve!
|
Mark M. |
how can I help you today?
|
Steve S. |
Hi Mark!
|
Feb 1 | 4:00 PM |
Steve S. |
My app has a terms of service in a WebView, however I've been noticing various issues in Crashlytics
|
Steve S. |
NameNotFoundException: com.google.android.webview
|
Mark M. |
my impression has been that this comes from devices with a messed up System WebView app
|
Steve S. |
ClassNotFoundException: com.android.webview.chromium.WebViewChromiumFactoryProvider
|
Steve S. |
Right
|
Mark M. |
same thing
|
Steve S. |
Is there any workarounds that you know of?
|
Mark M. |
nope
|
Mark M. |
other than to avoid WebView
|
Mark M. |
for example, a terms of service might work just in a TextView, perhaps using Html.fromHtml()
|
Mark M. |
unless you have an awfully fancy terms of service... :-)
|
Steve S. |
Marquees and everything!
|
Steve S. |
Jk ;)
|
Dave S. | has entered the room |
Steve S. |
Thanks for the suggestion
|
Steve S. |
I have another question while I'm here, after Dave
|
Mark M. |
OK
|
Mark M. |
hi, Dave!
|
Dave S. |
Hi Mark and Steve. This is my first time here.
|
Mark M. |
it's your turn -- do you have a question?
|
Dave S. |
I have a zillion questions but would rather take today to just get acclimated. Eavesdrop, if you will!
|
Mark M. |
um, OK
|
Mark M. |
if you have a question at some point, chime in to let me know
|
Dave S. |
So go ahead, Steve.
|
Mark M. |
Steve: back to you!
|
Feb 1 | 4:05 PM |
Dave S. |
I will chime in if I need to. Thanks.
|
Steve S. |
Ok
|
Steve S. |
We actually wrote a s/o post about it but haven't gotten any responses
|
Steve S. | |
Steve S. |
About the architecture components lifecycle observers
|
Mark M. |
how are you registering the observer? unregistering is usually handled by the Lifecycle
|
Steve S. |
We add the observer in the constructor of the class
|
Mark M. |
oh, I see
|
Steve S. |
And we don't know if we have to explicitly listen for onDestroy
|
Steve S. |
And remove the observer
|
Steve S. |
Or if it does that automatically
|
Mark M. |
yeah, sorry, I was thinking about LiveData
|
Mark M. |
I don't work with observers directly very much
|
Steve S. |
I noticed the documentation and examples don't really use removeObserver
|
Steve S. |
They only mention adding it
|
Steve S. | |
Feb 1 | 4:10 PM |
Mark M. |
I don't know what the official rules are, and I'd need to poke through the sources to try to get a bead on what is required
|
Mark M. |
generally, they hold things weakly, and so my guess is that you can get away without unregistering, if the Lifecycle is going out of scope (e.g., the activity is getting destroyed)
|
Steve S. |
Ok
|
Mark M. |
so, off the cuff, I don't have a definitive answer for you -- sorry!
|
Steve S. |
Right, that's what I assume, but we've been removing it just in case
|
Steve S. |
That's ok, was just curious if you did :)
|
Steve S. |
Thank you!
|
Steve S. |
I believe that is everything I have, thanks a lot!
|
Mark M. |
you're welcome!
|
Dave S. |
Hey, Mark. Like I said, just dropping in, first time, see what it's like. I have to go to bank and eat a meal before a meeting I have at six. So I'm leaving, too. I'll be back. Thanks for all the times you've helped me, directly and indirectly.
|
Mark M. |
happy to be useful!
|
Mark M. |
tell the bank and meal that I said "hi!" :-)
|
Feb 1 | 4:15 PM |
Steve S. | has entered the room |
Mark M. |
hi, Steve S #2!
|
Steve S. |
Hi Mark!
|
Dave S. |
Interestingly, all my life people have referred to me as Steve. So can I be Steve S. #3? Or is Dave better?
|
Dave S. |
But I'm gone anyway!
|
Mark M. |
Steve: how can I help you today!
|
Dave S. | has left the room |
Feb 1 | 4:20 PM |
Steve S. |
Which one?
|
Mark M. |
at this point, any Steve can ask a question :-)
|
Steve S. |
Steve Strates, you were here first - do you want to ask first?
|
Mark M. |
the original Steve had indicated that he was done with questions earlier (sorry that you can't scroll backwards in the live chat transcript to see...)
|
Steve S. |
sure, then i'll paste in a question:
|
Steve S. |
I'm working on a master-detail interface that needs to run on both a large-format and a small-format device. I know a common way to implement this is to use fragments. I also know that some people think you should avoid fragments. Is it reasonable for me to implement this using fragments, or is there an alternative I should consider?
|
Mark M. |
a common problem in programming overall, and in Android in particular, is that there are attitude waves
|
Mark M. |
AsyncTask was awesome, then it was horrible
|
Mark M. |
fragments were awesome, then they were horrible
|
Mark M. |
in reality, both were fine, when used correctly
|
Steve S. |
ok
|
Mark M. |
but they weren't the all-singing, all-dancing, magic-bulleting solutions that people originally thought
|
Mark M. |
so, fragments are fine
|
Mark M. |
to put it another way, I'm doing master-detail-y work, and I'm using fragments
|
Steve S. |
great. that's very helpful!
|
Steve S. |
then i'll use fragments. are problems with fragments more likely to arise when you're doing things like nesting them?
|
Mark M. |
I never liked nested fragments
|
Mark M. |
that was due to bugs in early versions
|
Mark M. |
I haven't seen all that many complaints about them in recent years
|
Feb 1 | 4:25 PM |
Steve S. |
i see
|
Mark M. |
so if you need 'em, and can keep track of the right FragmentManager instances to use, give it a whirl
|
Mark M. |
the only use case I ever found compelling for them was fragment -> ViewPager -> fragments as pages
|
Mark M. |
and I've switched to a RecyclerView in lieu of a ViewPager
|
Mark M. |
so I haven't had a use case for nested fragments in a while
|
Steve S. |
sure. what do you mean: "keep track of the right FragmentManager"?
|
Mark M. |
a fragment working with nested fragments should use getChildFragmentManager()
|
Mark M. |
for any transactions related to those nested fragments
|
Steve S. |
i see. i won't be using nested fragments, so that shouldn't be an issue for my use case
|
Mark M. |
so, for example, in my fragment -> ViewPager -> fragments as pages scenario, you would use the FragmentManager returned by getChildFragmentManager() with your FragmentPagerAdapter
|
Steve S. |
ok
|
Steve S. |
i don't have any more questions today
|
Mark M. |
OK
|
Steve S. |
thanks so much for your expert advice, Mark!
|
Mark M. |
you're very welcome!
|
Steve S. |
have a great rest of the day!
|
Mark M. |
and now I eagerly await the next Steve S to enter the chat, so I can hit the trifecta... :-)
|
Mark M. |
you too!
|
Steve S. |
shouldn't take long...
|
Steve S. | has left the room |
Feb 1 | 4:30 PM |
Steve S. | has left the room |
Feb 1 | 4:55 PM |
Mark M. | turned off guest access |