귀하의 질문에 따르면, 귀하는 onActivityResult
부분으로 가장 힘들어하는 것처럼 보입니다.
당신이 당신의 이미지 파일 경로를 검색 한 후
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == 0 && data != null && data.getData() != null) {
Uri uri = data.getData();
if(uri != null) {
Cursor cursor = getContentResolver().query(uri, new String[] {
android.provider.MediaStore.Images.ImageColumns.DATA},
null, null, null);
cursor.moveToFirst();
String imageFilePath = cursor.getString(0);
cursor.close();
if(imageFilePath != null) {
// Do whatever you want like decode it into a Bitmap
Bitmap bitmap = BitmapFactory.decodeFile(imageFilePath);
// Or.. store it somewhere in your local db
}
}
}
}
, 당신은 당신이 원하는 무엇이든 할 자유 :
그것은이 같은해야한다. 앞에서 말했듯이, 예를 들어 사용자 테이블의 로컬 데이터베이스에이를 분명히 저장할 수 있습니다.