I got help from android: how to register my application as a “camera application” , but still it doesn’t work properly
I tried using my Contact App to add a photo to an existing saved contact with which the URI will be created, as shown below
content:
but I can’t access this contact directory, so I can’t save the photo above this URI, and if I do, I will get a FIleNotFoundException ,
Uri saveUri = (Uri) getIntent().getExtras().getParcelable(MediaStore.EXTRA_OUTPUT); if (saveUri != null) {
Manovism
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <activity android:name=".CameraSelfieActivity" android:clearTaskOnLaunch="true" android:icon="@drawable/icon_chooser_selfie" android:label="My Camera" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.media.action.IMAGE_CAPTURE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
Logcat
java.io.FileNotFoundException: /my_cache/ContactPhoto-IMG_20170417_205819.jpg: open failed: ENOENT (No such file or directory) at libcore.io.IoBridge.open(IoBridge.java:452) at java.io.FileInputStream.<init>(FileInputStream.java:76) at com.example.CameraSelfieBaseHelper.copyFileToUri(CameraSelfieBaseHelper.java:391) at com.example.CameraSelfieBaseHelper.processImageReady(CameraSelfieBaseHelper.java:364) at com.example.CameraSelfieBaseHelper.onImageReady(CameraSelfieBaseHelper.java:266) at com.example.captureImage(CmGLSV.java:50) at com.example.surface.CmGLSV.onDrawFrame(CmGLSV.java:135) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1535) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory) at libcore.io.Posix.open(Native Method) at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186) at libcore.io.IoBridge.open(IoBridge.java:438)
but the same functionality is achieved by default Camera App
anybody suggest how to solve this problem
Thanks,
Siddhpura amit
source share