android - NullPointerException while trying to startActivityForResult -
android - NullPointerException while trying to startActivityForResult - edit: reply not phone call startactivityforresult on called activity object, instead invoke caller's context. this code, exception on lastly line: 107 intent intent = new intent(callingactivity.this, calledactivity.class); 108 calledactivity calledactivity = new calledactivity(); 109 calledactivity.startactivityforresult(intent, called_activity_code); inside callingactivity: @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); log.i(sr.tag,"req=" + requestcode + " res=" + resultcode); //never getting here } manifest file snippet: <activity android:name=".ui.callingactivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category and...