2
Eclipse在下面的代碼中給TAKE_PICTURE一個錯誤。我嘗試用CAMERA_PIC_REQUEST替換它,並得到相同的錯誤。我正在爲Android 4.2進行開發。用相機拍照Android在Eclipse中出現錯誤
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File file = new File(Environment.getExternalStorageDirectory(), "test.jpeg");
Uri outputFileUri = Uri.fromFile(file);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, TAKE_PICTURE);
}
任何想法我必須做什麼?
什麼是錯誤。 – nhaarman