android捕获照片并保存在图像视图中,然后发送彩信?

android捕获照片并保存在图像视图中,然后发送彩信?,android,eclipse,imageview,android-camera,Android,Eclipse,Imageview,Android Camera,如果我不想要照片,我想在图像视图中使用“删除”按钮拍摄照片并将其显示在图像视图中,然后再拍摄一张照片并通过彩信发送照片。声明按钮和图像视图 ImageView imageView= (ImageView)this.findViewById(R.id.imageView1); Button photoButton = (Button) this.findViewById(R.id.button1); 单击按钮以捕获图像 photoButton.setOnClickListener(new Vi

如果我不想要照片,我想在图像视图中使用“删除”按钮拍摄照片并将其显示在图像视图中,然后再拍摄一张照片并通过彩信发送照片。

声明按钮和图像视图

ImageView imageView= (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
单击按钮以捕获图像

 photoButton.setOnClickListener(new View.OnClickListener() {
       public void onClick(View v) {
                Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
                startActivityForResult(cameraIntent, CAMERA_REQUEST); 
            }
        });
将捕获的图像放入ImageView

protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
        if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) {  
            Bitmap photo = (Bitmap) data.getExtras().get("data"); 
            imageView.setImageBitmap(photo);
        }  
    }
需要添加到清单文件中

<uses-feature android:name="android.hardware.camera"></uses-feature> 
我不太清楚发送该图像的彩信

更多参考


你可以查一下这个问题的答案。您还应该参考。我想了解CAMERA_REQUEST=1888的含义;