• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Side-bar menu navigation

grockious

Lurker
Hi
I am a new developer
I wanna know how can I add a side bar menu (just like Google Keep) to my App. (I have chosen the API7)
Thanks
 
API 7 is 2.1, API 8 is 2.2 :)


Also, read the tutorial :)



The Support Library makes it backwards compatible all the way to ~ 1.6.
So this means I can use "API 14 for example+Support Lib" to allow Android 2.1 users, install my App? Or it means I choose API 7+Support Lib to engage my App with useful features like Navig. Drawer?
thanks again
 

Attachments

  • Error.jpg
    Error.jpg
    98.5 KB · Views: 88
Hi grockious,

To resolve the bug, please see below:

1. Declare String array variable as below:
String[] drawerListViewItems = getResources().getStringArray(R.array.planets_array);

In res->Values->string.xml, declare planets_array as
<string-array name="planets_array">
<item>Mercury</item>
<item>Venus</item>
<item>Earth</item>
<item>Mars</item>
<item>Jupiter</item>
<item>Saturn</item>
<item>Uranus</item>
<item>Neptune</item>
</string-array>

2. To resolve error at " drawerListView = (ListView ) findViewById(R.id.left_drawer); "
Import Listview library : (Shortcut : press Ctrl + Shift + O )

3. Import ArrayAdapter and re-write as follows:
drawerListView.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, drawerListViewItems));

Hope this helps,

Cheers!
 
Back
Top Bottom