I\'m trying to follow this tutorial on how to create a Navigation Drawer, but I don\'t want to use Fragments to show new content after the user select an item from the drawer li
First, API 10 has access to fragments via the same Android Support package that contains the DrawerLayout
. This has been around for over two years, and you should not be trying to mess with new things like DrawerLayout
if you are unfamiliar with what Android has had for the past two years.
Second, there is nothing with DrawerLayout
that is tied to fragments. Quoting the Web page that you linked to:
When the user selects an item in the drawer's list, the system calls onItemClick() on the OnItemClickListener given to setOnItemClickListener(). What you do in the onItemClick() method depends on how you've implemented your app structure.
If you read those two sentences closely, you will see that the word "fragment" appears in neither of them. That is because DrawerLayout
is not tied to fragments. The sample code they show uses fragments, but that is merely sample code.
Hence, you are welcome to update your UI however you want:
FragmentTransaction
using the Android Support package's backport of fragments, orsetContentView()
again on your existing activity, or