[Java for Android App Development] Moonbloom:
I'm currently trying to combine SlidingMenu (https://github.com/jfeinstein10/SlidingMenu) with ExpandableListView, but i'm running into some issues.

I've got SlidingMenu working fine, and it can inflate a view.

My problem comes when i try to call the .java file associated with the ExpandableListView.

I get a NullPointerException when i try to call methods on my ExpandableListView object, but i've followed guides and google'd around to fix the issue, yet i haven't found a proper way to call the constructor for it.

The constructor requires a Context, but none of the ways i know how to get the context works (it still gives me an error).

I've shown part of my MainActivity below, where i set the SlidingMenu to the correct view (this works fine), and where i start the SlideMainMenu activity (this populates and setups my ExpandableListView).

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

SlidingMenu menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setFadeEnabled(true);
menu.setShadowDrawable(R.drawable.shadow);
menu.setFadeDegree(0.80f);
menu.setBehindOffset(50);
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setMenu(R.layout.expand_listview_main);

//TEST START
Intent intent = new Intent(this, SlideMainMenu.class);
startActivity(intent);
//TEST END

I've also shown part of my SlideMainMenu.java file, more precisely the part that throws the NullPointerException.

The NPE happens when i try to call "expandableListView.setAdapter(listAdapter);"

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.slide_left_main_menu);

expandableListView = (ExpandableListView) findViewById(R.id.ExpandableListView_Main);
prepareListData();
listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);

//TEST START
if(findViewById(R.id.ExpandableListView_Main) == null)
{
Log.d("DAMN","It's a god damn null value - " + expandableListView);
}
else
{
Log.d("DAMN","It's NOT NULL! YAAY! - " + expandableListView);
}
//TEST END
expandableListView.setAdapter(listAdapter);

I've also included the LogCat when the app crashes on a virtual machine.

02-08 19:06:00.862: V/CustomViewBehind(774): behind INVISIBLE
02-08 19:06:00.911: D/DAMN(774): It's a god damn null value - null
02-08 19:06:00.921: D/AndroidRuntime(774): Shutting down VM
02-08 19:06:00.921: W/dalvikvm(774): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
02-08 19:06:00.921: E/AndroidRuntime(774): FATAL EXCEPTION: main
02-08 19:06:00.921: E/AndroidRuntime(774): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.moon.ihaquiz/com.moon.ihaquiz.SlideMainMenu}: java.lang.NullPointerException
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.os.Handler.dispatchMessage(Handler.java:99)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.os.Looper.loop(Looper.java:137)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread.main(ActivityThread.java:5041)
02-08 19:06:00.921: E/AndroidRuntime(774):	at java.lang.reflect.Method.invokeNative(Native Method)
02-08 19:06:00.921: E/AndroidRuntime(774):	at java.lang.reflect.Method.invoke(Method.java:511)
02-08 19:06:00.921: E/AndroidRuntime(774):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-08 19:06:00.921: E/AndroidRuntime(774):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-08 19:06:00.921: E/AndroidRuntime(774):	at dalvik.system.NativeStart.main(Native Method)
02-08 19:06:00.921: E/AndroidRuntime(774): Caused by: java.lang.NullPointerException
02-08 19:06:00.921: E/AndroidRuntime(774):	at com.moon.ihaquiz.SlideMainMenu.onCreate(SlideMainMenu.java:43)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.Activity.performCreate(Activity.java:5104)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-08 19:06:00.921: E/AndroidRuntime(774):	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-08 19:06:00.921: E/AndroidRuntime(774):	... 11 more
02-08 19:06:40.946: I/Process(774): Sending signal. PID: 774 SIG: 9

Hope some one can help me out with this problem, and if anyone has ideas to improve my code, feel free to say it as i'm still a bit new to Android/Java and i'm learning as i go.