Hi All, Hi Brian and Phillips
I just finished chapter 12 and I think I am missing something.
I have been doing software development for more than 30 years mainly in C, C++ and Obj C (I bought your book on IOS programming and have been very satisfied with it, that is why I am coming back )
But I am quite new to Java and to Android programming, may be that’s the reason why I am puzzled.
Anyway, my problem is that I don’t understand why the communication between our 2 fragments is done in such a complicate way and why we have to use so often the Bundle.
First, sending the date to the datePickerFragment.
In the newInstance method (in DatePickerFragment.java), why don’t we directly set mDate with the date. I mean once the “new DatePickerFragment()” method has been called, the DatePickerFragment object exists no ? Then, why can’t we directly set its mDate member from there ?
Why passing it into the bundle and retrieve it from the arguments inside the onCreateDialog method
Second : sending data back to the CrimeFragment.
is it really necessary to follow all this long track ?
I mean, isn’t it something a little bit less complicate like callback function or delegate, without having to store the result date in an Intent and do all those strange things ?
To be honnest with you, it is not the first time I think that things are done in a way that seems complicate or not very logical to me. Now, as I trust the way you do things (once again, I really learned a lot on IOS with Big Nerd Ranch Guide), I conclude that it is Android dev which sometimes takes complicate ways. I guess it is a matter of history (keep compatibility between android releases).
So, am I missing something ?
Thanks again for your great books,