Hacker News new | ask | show | jobs
by Zigurd 4455 days ago
Your Fragment subclasses is where your code that interacts with the user should be (the code that used to be in your Activity subclasses). Activity should contain Fragment objects by means of loading a layout.

The cool thing about Fragment is that you can organize your Fragment subclasses using different layout files, and you can organize the layout files using resource qualifiers. That means that Android is picking your layouts, and the number and layout of Fragment objects on a particular screen geometry, for you, instead of you having to write code that groks screen size, density, and text size.

I dislike navigation drawers almost as much as I disliked the now deprecated "dashboards." It is a place where you can do nothing but go some other place. If you have that big an app, I suppose it's OK. But making navigation a natural part of, say, picking an item from a list, or picking a menu item is preferable. Nav drawers look better than dashboards, but if you consider them from the user interaction PoV, they are the same.

Yes to using Bundle objects to move data. That's how sending data to a Fragment is independent of whether it is in the same Activity or not.