Office Hours — Today, April 29

Tuesday, April 25

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
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
I very rarely use those wizards, as I wind up having to rip out more code than it saves me typing
Rick
Ah
So just new Java Class?
Mark M.
yes
yeah, I don't see a DialogFragment wizard item, or anything related to dialogs
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.
me either
Mark M.
no
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:
I'm a CS adjunct at a university here in CT>
I was asked to teach Android
I don't know Android. :)
Mark M.
that would seem to be a slight hiccup in the plan :-)
Rick
You'd think
So, I know a bit now and I know Java.
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
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
that's fairly commonplace
Rick
makes learning a little more difficult
enter your book
updated very quickly it seems
Mark M.
every 4-8 weeks
Rick
dirt cheap (no offense)
I still have students who "can't afford" it
$20!
Mark M.
understood
Rick
skip a beer
Mark M.
well, that'd be an expensive beer
4:55 PM
Rick
You get my point
Mark M.
certainly
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.
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
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
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.
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
they just see it somewhere and try to copy it everywhere
or just plain skip it
either way, they're done
they don't understand scope
"just doesn't work"
well you don't have a reference to the view here...
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
I'm looking to get back into public training (the kind anyone can sign up for) soon
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
I've read some differences from onCreateView vs onCreateDialog
does that application need onCreateDialog?
Mark M.
that depends a bit on how you want to set up the ListView
if you want to use the stock AlertDialog implementation, then you would use onCreateDialog()
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
AlertDialog can have a listview in it?
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
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
at least, not that I recall
Rick
alright, thanks
Mark M.
that's a wrap for today's chat, then
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
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
View paste
you too!
Rick
has left the room
Mark M.
turned off guest access

Tuesday, April 25

 

Office Hours

People in this transcript

  • Mark Murphy
  • Rick