color/a.xml ColorStateList colorStateList = null; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { colorStateList = context.getResources().getColorStateList(R.color.a, context.getTheme()); } else { colorStateList = context.getResources().getColorStateList(R.color.a); } textView.setTextColor(colorStateList) 요렇게 하면, 간단하게 컬러 리스트를 동적으로(programmatically) 적용 할 수 있다.
브로드 캐스트 리시버 에서는 10 초 이내에 모든 작업을 완료 해야함. 그렇지 않으면 시스템이 죽여 버리거나, ANR을 발생 시킨다. 1. onReceive 에서 최대한 간결하게 코드를 처리 한다.1.1 다른 서비스로 리턴 시킨다.1.2 또는 goAsync()를 사용 하여 타임아웃을 연장 한다. 아래는 구글의 설명이다. /** * This can be called by an application in {@link #onReceive} to allow * it to keep the broadcast active after returning from that function. * This does not change the expectation of being relatively * responsive to..
처음 저장소 생성 후 push 할 때 android studio bitbucket push rejected Push rejected: Push to origin/master was rejected Updates were rejected because the tip of your current branch is behind 발생하면 1. VCS 2. GIT 3. Branches Rebase Current onto Selected 해주면 됨.
Fatal Exception: android.database.StaleDataException: Attempted to access a cursor after it has been closed. cursor.close() RingtoneManager로 얻은 Cursor 은 Close 하지 않아도 알아서 하니, 손대면 에러 발생. 그냥 패스 하면 된다.