Attempt to invoke virtual method 'void android.widget.Spinner.setAdapter(android.widget.SpinnerAdapter)' on a null object reference

Hey,
I am using graphhopper sample of routing engine for android.
Now I have added some other activities(PoiSearchActivity) which extends the main activity and gave me the following error.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.Spinner.setAdapter(android.widget.SpinnerAdapter)’ on a null object reference
at com.graphhopper.android.MainActivity.chooseArea(MainActivity.java:498)
at com.graphhopper.android.MainActivity.chooseAreaFromLocal(MainActivity.java:421)
at com.graphhopper.android.MainActivity.onStart(MainActivity.java:231)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
at android.app.Activity.performStart(Activity.java:6699)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)

Can you please help me solve this.
Thanks.

Powered by Discourse