I have two activities Suppose A and B;
activity A has several objects of View [TextView
, TabView
, ListView
etc]:
I fire an Intent using startActivityForResult
and go to activity B
then i do my computation as required in activity B and return back to activity A by setRuslt
and then finish();
on returning to my onActivityResult i work according to the result sent from activity B;
Everything above works perfectly fine.[During testing]
But when i have deployed my application I am facing crashes [unexpected Nullpointer exception]
-> In some cases ListView inside my onResume method is null;
-> In some cases my tabView is null;
-> In some cases my database object instance is null;
am I missing any important step of the activity lifecycle. It works fine while in testing.
Please Note: I have map Views on both the activities
Please help. Thank you in advance.
HERE's AN STACK TRACE
java.lang.NullPointerException
at in.abmulani.thisway.MainActivity.onKeyDown(MainActivity.java:511)
at android.view.KeyEvent.dispatch(KeyEvent.java:2719)
at android.app.Activity.dispatchKeyEvent(Activity.java:2419)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:190)
at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:4150)
at android.view.ViewRootImpl.handleImeFinishedEvent(ViewRootImpl.java:4112)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3292)
at android.os.Handler.dispatchMessage(Handler.java:99)