팝업창 생성하기 위해서
public void GoImgPopUp() {
ImageView one=(ImageView)findViewById(R.id.i1);
Bitmap mmm = one.getDrawingCache();
BitmapDrawable bmpResized = BitmapResize(50);
LayoutInflater factory = LayoutInflater.from(this);
final View Dialer = factory.inflate(R.layout.introdu, null);
Activity mCurrentView = null;
final ImageView LFImage = (ImageView) mCurrentView.findViewById(R.id.i1);
LFImage.setImageDrawable(bmpResized);
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setView(Dialer);
AlertDialog alert_goImgDlg = alert.create();
alert_goImgDlg.show();
}
public BitmapDrawable BitmapResize(int i){
Bitmap bitmapOrg = null;
int width = bitmapOrg.getWidth();
int height = bitmapOrg.getHeight();
int newWidth = 400;
int newHeight = 600;
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0, width, height, matrix, true);
BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);
return bmd;
}
onClicke메소드에는 대충
else if (v.getId() == R.id.one){
AlertDialog alert_goImgDlg = null;
GoImgPopUp();
} //one은 이미지뷰입니다.
이렇게 선언해주었는데요
..
FATAL EXCEPTION : MAIN
java.lang.nullpointerexception
에러가 뜹니다. 위 코딩에서 잘못된 부분이 있나요?ㅠ
로그캣 내용을 확인해 보심이...