안드로이드 개발 질문/답변
(글 수 45,052)
넥서스S, 겔럭시2 에서는 아무 문제없이 잘 돌아가는데,
겔럭시 노트, 베가LTE, LGE LG optimus 이런 최신 폰에서는 돌아가다가 중지되었다고 메시지 뜨고 어플이 꺼지네요..
무슨 문제인지..ㅠ.ㅠ
다른 어플들은 아무 문제 없는데.. 이 어플만 자꾸 문제가생기네요..
문제가 될 것 같은 코드 올릴게요
Log에는
java.lang.OutOfMemoryError
android.graphics.bitmap.nativeCreate
android.graphics.bitmap.createBitmap
등등...
이런 오류가 나요..
이 코드는 스레드 사용한 것이구요
1.class BackThread extends Thread {1.public void run() {1.try {1.while (true) {1.count++;1.mHandler.sendEmptyMessage(0);1.Thread.sleep(1000);1.}1.} catch (InterruptedException e) {1.;1.}1.this.interrupt();1.}1.}1. 1.Handler mHandler = new Handler() {1.public void handleMessage(Message msg) {1.if (msg.what == 0) {1.if (count == 4) {1.Animation anim = null;1.anim = new TranslateAnimation(500, 0, 0, 0);1.anim.setZAdjustment(Animation.ZORDER_TOP);1.mPage2.setVisibility(View.VISIBLE);1.anim.setDuration(1000);1.mPage2.startAnimation(anim);1.}1.}1.}1.};이 코드는 인텐트 사용한 거에요
1.public boolean onKeyDown(int keyCode, KeyEvent event) {1.if(back==true){1.if (keyCode == KeyEvent.KEYCODE_BACK) {1.finish();1.Intent intent4 = new Intent(BodyActivity.this,1.BodyActivity.class);1.startActivity(intent4);1.back = false;1.}1.}1.else if (back==false){1.finish();1.}1.return true;1.}



로그를 같이 올려주시면 답변드리기 훨씬 편합니다.