Mark M. | has entered the room |
Mark M. | turned on guest access |
Apr 29 | 4:45 PM |
Rick | has entered the room |
Mark M. |
hello, Rick!
|
Rick |
Hi Mark
|
Mark M. |
how can I help you today?
|
Rick |
How do I add a DialogFragment to a Project?
|
Mark M. |
um, create a subclass of it, alongside the rest of your Java classes
|
Mark M. |
see https://github.com/commonsguy/cw-omnibus/tree/v... for an example
|
Rick |
Through the Android Studio GUI? Create a regular Fragment then just extend DialogFragment?
|
Mark M. |
oh, if you mean through some sort of wizard... I don't know if they have a DialogFragment wizard
|
Mark M. |
I very rarely use those wizards, as I wind up having to rip out more code than it saves me typing
|
Rick |
Ah
|
Rick |
So just new Java Class?
|
Mark M. |
yes
|
Mark M. |
yeah, I don't see a DialogFragment wizard item, or anything related to dialogs
|
Apr 29 | 4:50 PM |
Rick |
So you don't end up using all the options on the same drop down like new Activity or Fragment etc.
|
Rick |
me either
|
Mark M. |
no
|
Mark M. |
occasionally, I'll use the IntentService and BroadcastReceiver ones, as I don't have to rip out that much code
|
Rick |
Okay so, here's my story:
|
Rick |
I'm a CS adjunct at a university here in CT>
|
Rick |
I was asked to teach Android
|
Rick |
I don't know Android. :)
|
Mark M. |
that would seem to be a slight hiccup in the plan :-)
|
Rick |
You'd think
|
Rick |
So, I know a bit now and I know Java.
|
Rick |
My feeling is it's a little "wild west" right now
|
Mark M. |
I'm not sure what the "it's" refers to in that sentence
|
Rick |
Android development
|
Mark M. |
:: shrug ::
|
Rick |
It seems to change rapidly
|
Mark M. |
oh, that's certainly true
|
Mark M. |
IMHO, the half life of a blog post or Stack Overflow answer is about 18 months
|
Rick |
k so when I try to find examples or students try to find examples 90% maybe more are outdated
|
Mark M. |
yes
|
Mark M. |
that's fairly commonplace
|
Rick |
makes learning a little more difficult
|
Rick |
enter your book
|
Rick |
updated very quickly it seems
|
Mark M. |
every 4-8 weeks
|
Rick |
dirt cheap (no offense)
|
Rick |
I still have students who "can't afford" it
|
Rick |
$20!
|
Mark M. |
understood
|
Rick |
skip a beer
|
Mark M. |
well, that'd be an expensive beer
|
Apr 29 | 4:55 PM |
Rick |
You get my point
|
Mark M. |
certainly
|
Mark M. |
it's one of the reasons I switched from $45/year to $20/6-months, to lower the cost of entry
|
Rick |
anyway, I'm trying to make it a text for the class.
|
Rick |
plus, you can't beat office hours with the author included
|
Mark M. |
I've helped a few students over the years
|
Rick |
I bet
|
Rick |
so, this time you're going to be helping the instructor :)
|
Mark M. |
I've done that on occasion too :-)
|
Rick |
I'd also bet
|
Rick |
so, you'll certainly be hearing from me. I think one of the biggest problems my students face is a lack of solid Java skills
|
Mark M. |
yeah, and that's an area where my book doesn't really help much
|
Rick |
I asked if they knew what inheritance was and oh sure, yeah, we all know that. Then I asked.
|
Rick |
I went all the way around the room and only 1 student knew
|
Mark M. |
that will make learning standard Android development somewhat difficult
|
Rick |
They don't know why you call a parent's version of a method in one of these examples
|
Rick |
they just see it somewhere and try to copy it everywhere
|
Rick |
or just plain skip it
|
Rick |
either way, they're done
|
Rick |
they don't understand scope
|
Rick |
"just doesn't work"
|
Rick |
well you don't have a reference to the view here...
|
Apr 29 | 5:00 PM |
Rick |
then factor my shaky android and it's tough
|
Mark M. |
this is why I stick to professional training
|
Rick |
you hold android classes for android devs?
|
Mark M. |
right now, it's just private training for organizations
|
Mark M. |
I'm looking to get back into public training (the kind anyone can sign up for) soon
|
Mark M. |
stay tuned to my blog for further details
|
Rick |
So, anyway, hour's up but one last question please. So, this student wants to click a button in his main activity open a dialogfragment with a listview
|
Rick |
I've read some differences from onCreateView vs onCreateDialog
|
Rick |
does that application need onCreateDialog?
|
Mark M. |
that depends a bit on how you want to set up the ListView
|
Mark M. |
if you want to use the stock AlertDialog implementation, then you would use onCreateDialog()
|
Mark M. |
if you would prefer to set that up yourself, with your own ListAdapter, then you would use onCreateView()
|
Rick |
I think he wants something else in the main activity to pick an array and then to use an array adapter
|
Rick |
AlertDialog can have a listview in it?
|
Rick |
he's trying to use a listadapter now and onCreateView but it's not working
|
Mark M. |
yes, though it's easiest to set up via AlertDialog.Builder
|
Apr 29 | 5:05 PM |
Mark M. |
there is a setAdapter() method, or you can use setCursor(), setItems(), or setMultiChoiceItems() for a stock adapter
|
Rick |
there an example in your book?
|
Mark M. |
not of an AlertDialog with a list, sorry
|
Mark M. |
at least, not that I recall
|
Rick |
alright, thanks
|
Mark M. |
that's a wrap for today's chat, then
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Rick |
I just need time. Between the regular job, teaching classes, the 4 year old...
|
Mark M. |
the next chat is Monday, also at 4pm US Eastern
|
Rick |
I really appreciate the chat help
|
Rick |
and the book format
|
Mark M. |
you are very welcome
|
Rick |
thank you. I think it'll really help myself and my students.
|
Mark M. |
have a pleasant (rest of the) day!
|
Rick | |
Rick | has left the room |
Mark M. | turned off guest access |