【发布时间】:2011-12-18 13:51:28
【问题描述】:
谁能帮我解决这个问题?
下面的代码在我的 HTC Desire S 上完美运行,但在其他设备(我怀疑不是 HTC
另外,如果我连续拍摄超过 4 张照片,我的应用程序就会崩溃 - 这是一个已知问题吗?也许有人可能有我可以使用的自定义实现?
我目前正在使用此代码启动图像捕获并保存到特定位置:
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, 0);
这是我的 onActivityResult 代码:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Bitmap bm = null;
switch (resultCode) {
case 0:
break;
case -1:
if (data != null) {
try {
// first, open the bitmap so we can scale it down..
bm = Media.getBitmap(this.getContentResolver(),
outputFileUri);
..more code here ..
} catch (Exception e) {
// log exception}
}
} else {
// log image returned null data...
}
}
}
我们将一如既往地为您提供帮助!
【问题讨论】:
-
你能显示来自 logcat 的日志吗?