I’ve faced with a question if it’s necessary to rewrite my application for using Fragments API. The application contains only Activities, every of which is responsible for one screen only and will not contain two ore more fragments on one screen as in the SDK example. Should I rewrite the application to Fragments API?
In the case if I must rewrite, could you please tell me which structure should be used in the project:
- Each Activity will contain one Fragment and manage it.
- There is only one activity and all the other Activities should be rewritten to Fragments.
In general it`s not clear when the Fragment should be used.
Implementing
Fragments in this case is just extra work. If you can get the effect you want using onlyActivitys, that’s perfectly fine.That said, implementing your application using
Fragments even when its not necessary isn’t always a bad idea, as it makes transitioning to multiscreen layouts quite simple. If you can see yourself optimizing for tablets at some point in the future, implementing your UIs withFragments might be a good idea.