0
我是新開發的Android開發人員,當我想到查找和保存我剛剛用相機應用程序拍攝的圖片等基本要素時,我就陷入了沉寂。到目前爲止,這是我得到的相機應用如何查看我剛剛在android開發中使用的圖像?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
代碼,這是我不完全OnActivityResult()方法
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ImageView rondo = null;
Bundle extras = data.getExtras();
Bitmap mImageBitmap = (Bitmap) extras.get("data");
rondo.setImageBitmap(mImageBitmap);
setContentView(R.layout.activity_main);
}
,這是我對這個活動
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<ImageView android:id="@+id/imageViewName"
android:layout_width="90dp"
android:layout_height="90dp"
android:scaleType="fitStart"
android:adjustViewBounds="true"
android:padding="10dp"
/>
/>
</LinearLayout>
佈局我正在試圖獲取我在佈局中指定的位置的圖像,如ImageView所示。但是,我拍攝照片後,我的應用程序一直崩潰。我不知道我在做什麼,所以任何意見是有益的
我們需要來自logcat的堆棧跟蹤來提供幫助。請編輯您的問題並加入。 – Simon