当将使用相机拍摄的图像从相机意图返回到父意图(使用putExtra作为byte [])时,我在logcat中得到Failed binder事务错误.我不明白为什么,它不像它的大位图或任何东西.它只发生在我用大量光线拍照时,因为那时字节[]更大.离开相机意图时会发生错误.有没有人在我的代码中看到错误?
这是相机意图的代码:
package example.imaging.ape;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnTouchListener;
public class TakePicture extends Activity implements SurfaceHolder.Callback{
Camera mCamera;
Boolean mPreviewRunning = false;
int imageLayoutHeight;
int imageLayoutWidth;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setup camera surface
getWindow().setFormat(PixelFormat.TRANSLUCENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.cameralayout);
SurfaceView mSurfaceView = (SurfaceView) …Run Code Online (Sandbox Code Playgroud) 我在ActivityA中有位图我想将位图从这里传递给ActivityB,我用谷歌搜索了这个.当我用这个
Intent intent = new Intent(this, NewActivity.class);
intent.putExtra("BitmapImage", bitmap);
Run Code Online (Sandbox Code Playgroud)
获得
Bitmap bitmap = (Bitmap) intent.getParcelableExtra("BitmapImage");
Run Code Online (Sandbox Code Playgroud)
我收到这个错误!失败的粘合剂交易!.我怎么解决这个问题.