在我的应用程序中,我需要捕获一些图像并将它们保存在具有重命名选项的文件夹中。感谢您的帮助,对不起我的英语不好.....我试过了,但它不起作用,它只保存一张图像甚至拍摄更多照片,为什么?感谢:D
public class TestPress extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.prova);
final String direct = this.getIntent().getStringExtra("key");
// TODO Auto-generated method stub
Button p = (Button) findViewById(R.id.button2);
p.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent camera= new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
Uri uriSavedImage=Uri.fromFile(new File("/sdcard/CameraTest/flashCropped.png"));
camera.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
startActivityForResult(camera, 1);
}
});
Button np = (Button) findViewById(R.id.button3);
np.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent next = new Intent(Press.this, CameraActivity.class);
startActivity(next);
}
});
}
}