[안드로이드 공부] 204

[안드로이드] Performing stop of activity that is not resumed

안드로이드 액티비티 포즈시에 아래와 같은 에러가 발생 한다면 Performing stop of activity that is not resumed @Override public void onPause() { super.onPause(); Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { abcdefg(); } }, 100); } 포즈시 오래 걸리는 작업은 위와 같이 좀 지연을 시키면 된다.

안드로이드 스튜디오 디버그 안나올 때

안드로이드 스튜디오 사용 중 갑자기 디버그가 전혀 안 먹히는 경우가 있다.(Android monitor의 no debuggable applications 여기에 앱이 전혀 잡히지 않는 경우)디버그 모드로 바꿔도 안되고, 디바이스 개발자 모드 다시 설정해도 안된다. 이럴때는 간단하게벌레 모양 디버그를 한번 눌러주면 된다. 끝.

애드몹 사용시 테스트 디바이스를 등록해야 하는 이유

애드몹을 사용한다면 디버그 모드일 경우에는 왠만하면 test 기기 등록(.addTestDevice)하고 사용하는 것이 좋다. 노출수등에서 정확한 수치도 못 가져오고 및 앱 성능에도 좋지 않다. AdRequest.Builder() .addTestDevice("adfdsfdsrefrrfsdfds3r32fsdfsdfsdfa324ref2") 디바이스 넘버는 디버그 창에 위 글자 그대로 나온다. .addTestDevice( 테스트 디바이스 등록 하지 않으면 아래 에러도 볼 수 있다. JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined (:1) 그리고광고 show 할 때runOnUiThread(new Runnable() { public void run(..

ReceiverCallNotAllowedException: BroadcastReceiver components are not allowed to bind to services

브로드캐스트 리시버에서 또 다른 브로드캐스트 리시버를 등록하려고 할때 발생하는 에러다. android.content.ReceiverCallNotAllowedException: BroadcastReceiver components are not allowed to bind to services 그런데, 이것도 타이밍이 있다. 분명 디스트로이가 된 후에 등록 하려고 했으나, 계속 같은 에러가 발생 할 때가 있다. 왜?명시적으로 이전에 사용했던 서비스를 완전히 죽여 주지 않아서 그렇다. 1. A 리시버에서 B서비스를 생성 하고 사용 한 뒤,2. 다시 A리시버에서 B서비스를 생성 하려고 하면 발생한다. 즉, 1번 이후에 반드시 A에서 생성한 B를 죽여주자.

[FLAG_UPDATE_CURRENT의 비밀]Permission Denial: broadcasting Intent is not exported from uid

같은 어플리케이션 내에서 브로드캐스트를 주고 받는데 외부에서 접근하려고 한다는 에러가 뜬다. 참으로 골치 아픈 에러다.... W/BroadcastQueue: Permission Denial: broadcasting Intent act=com.comostudio.xxx flg=0x10000010 cmp=com.comostudio.xxx/.receiver.yyy } bnds=[556,596][768,692] from com.comostudio.xxx (pid=-1, uid=10000) is not exported from uid 10050 due to receiver com.comostudio.xxx/.receiver.yyy 아무리 인터넷을... 구글링을 해봐도 딱히 맞는 답이 없다. 1. 물론 export..

java.lang.RuntimeException: Performing stop of activity that is not resumed

보통 스플래시, 로딩화면을 넣은 경우 발생함. 이런 경우 앱 포즈시 발생하는 에러! 에러: java.lang.RuntimeException: Performing stop of activity that is not resumed 해결 : private final int SPLASH_DELAY_MESSAGE = 100; Handler splashHandler = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { switch (msg.what) { case SPLASH_DELAY_MESSAGE: startActivity(new Intent(mContext, MainActivity.class)); d..

android.content.ReceiverCallNotAllowedException

리모트 서비스등에서 발생하는 에러로 컨텍스트를 가지고 다니지 못할 때 발생한다. android.content.ReceiverCallNotAllowedException: components are not allowed to register to receive intents위젯, 브로드캐스트, 서비스등과 같이 유령같이 나타나는 얘들은 항상getContext가 아니라 getApplicationContext()를 써서 컨택스트를 들고 다녀야 한다. 스태틱 개념처럼 생각하면 될 듯.

안드로이드 adb 멀티 디바이스 사용 방법

여러대를 컴퓨터에 물려 놓고 사용하다 보면 한 번에 처리 해야 할 일들이 많지만 그때마다 기기를 뽑았다 꽃았다 하는 건 너무 불편하다. 디바이스 번호adb devices를 하면 기기 번호가 나온다adb -s 기기번호 shell pm clear 패키지명 ----> 특정 기기의 데이터만 삭제한다. USB에 물려있는 기기adb -d 에뮬레이터adb -e 요렇게 사용하면 뽑고 꽂고.... 난리 치지 않아도 된다.