在我的應用程序中,我想捕獲一張圖像,我希望它可以在另一個活動中查看。 我的相機編碼只適用於在SD卡中捕獲和存儲圖像,當我添加一些額外的代碼來將捕獲的圖像從一個活動移動到其他相機不工作時。在將圖像從相機捕獲移動到其他活動中的問題android
在logcat中顯示以下錯誤 04-08 17:28:43.771:錯誤/ AndroidRuntime(8717):java.lang.RuntimeException:無法啓動活動ComponentInfo {com.resting.gis/com.resting。 gis.Camera}:android.content.ActivityNotFoundException:無法找到顯式的活動類{com.resting.gis/View};你有沒有在你的AndroidManifest.xml中聲明這個活動?
但觀活動清單文件
以下被提及是我的代碼來捕捉圖像
protected static final int TAKE_RECEIPT = 0;
private Uri imageCaptureUri;
private String filename;
private Runnable submitReceiptRunnable = new Runnable()
{
public void run()
{
publishReceipt();
}
private void publishReceipt()
{
}
};
private ProgressDialog progressDialog;
OutputStream outStream;
Intent myIntent;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.camera);
takePictureFromCamera();
}
private void takePictureFromCamera()
{
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
imageCaptureUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(), "tmp_receipt_"
+ String.valueOf(System.currentTimeMillis()) + ".jpg"));
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageCaptureUri);
intent.putExtra("return-data", true);
startActivityForResult(intent, TAKE_RECEIPT);
String path = String.format("/sdcard/%d.jpg",System.currentTimeMillis());
try
{
outStream = new FileOutputStream(path);
doFileUpload(path);
Log.e("Camera",""+outStream);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
Intent i=new Intent();
i.setClassName("com.resting.gis","View");
i.putExtra("image", path);
startActivity(i);
}
private void takeReceiptCallback(int resultCode, Intent data)
{
if (resultCode == Activity.RESULT_OK)
{
submitReceipt();
}
}
private void submitReceipt()
{
Thread thread = new Thread(null, submitReceiptRunnable);
thread.start();
// progressDialog = ProgressDialog.show(this, "Please wait...", "Publishing receipt ...", true);
}
private String getBase64Receipt() {
try {
InputStream inputStream = getContentResolver().openInputStream(imageCaptureUri);
// byte[] bytes = CommonUtil.getBytesFromInputStream(inputStream);
// return Base64.encodeBytes(bytes);//(selectedImage.getPath().getBytes());
}
catch (IOException e)
{
Log.e("getbase64Reciept", ""+e);
}
return null;
}
private void publishReceipt()
{
String receipt = getBase64Receipt();
}
請幫我找到我要去的地方錯了