I'm calling ACTION IMAGE CAPTURE intent from a fragment, and I've implemented the onActivityResult()
in same fragment but the onActivityResult is not triggered while running it with my note2 device. Check the code snippets below that I used.
It worked fine when I am not using
import android.support.v4
Activity which I open fragment
public class HomeActivity extends FragmentActivity {
Fragment which I call Camera Intent
public class SaveCardFragment extends Fragment { private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 1888; ...
Calling Camera Intent
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent,CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE); ...
Function to detect activity result
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Log.d("Result", ""+requestCode); }
Configuration in AndroidManifest
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".HomeActivity" android:label="@string/title_activity_home"/>