I am trying to use this AndroidDrawer sidebar library. As per the instructions, following is my code in mainactivity. The code is crashing with application "has stopped - force close" message
public class MainActivity extends Activity {
Drawer mDrawer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mDrawer = Drawer.createLeftDrawer(this, R.layout.drawer_content);
mDrawer.init();
mDrawer.show();
}
}
Below is my drawer_content.xml - very simple just a textview:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_drawer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:text="Textview in drawer ... "
android:inputType="textPostalAddress" >
</TextView>
</LinearLayout>
The activity_main.xml is also a simple Textview only:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:text="asdsadd"
android:inputType="textPostalAddress" >
</TextView>
</LinearLayout>