[안드로이드 공부]/UI 50

Error : BinderProxy@ is not valid; is your activity running?

android.view.WindowManager$BadTokenException: Unable to add window — token android.os.BinderProxy@ is not valid; is your activity running? 보통 프로그래스 다이얼로그 띄우려고 하는데 발생 한다. 구글에서는 이런 에러를 이렇게 정의 하고 있다. 이 비정상 종료는 대개 앱에서 이전에 완료된 활동을 컨텍스트로 사용하여 대화상자를 표시하려고 시도하여 발생합니다. 예를 들어 활동이 종료되면 대화상자를 표시하려고 시도하는 AsyncTask를 트리거하지만 사용자가 작업이 완료되기 전에 활동에서 뒤로 이동하면 발생할 수 있습니다. 띄우려는 곳이 액티비티가 아니라면if(!((Activity) context).is..

Class not found when unmarshalling NoClassDefFoundError

Class not found when unmarshalling:Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack availableclass not found when unmarshalling startactivity 요런 에러가 막뜬다... 이럴 경우에multiDexEnabled true compile 'com.android.support:multidex:1.0.1' 등등을 하라고 한다.... 특정기기에서만 발생하는 거라... 참 어려운데.... 저런건 안 먹힌다... 결국 요상한 분석에 들어간다... StartActivity 에서 문제가있고... 인텐트로 데이터를 넘겨서 받을 때 ..

[안드로이드] actionBar, setDisplayShowHomeEnabled(boolean)' on a null object reference

setDisplayShowHomeEnabled(boolean)' on a null object reference 에러가 발생한다면? 1. getActionBar() 대신 getSupportActionBar() 대신 를 사용하거나, extends Activity 대신 extends AppCompatActivity를 사용 2.setSupportActionBar()를 먼저 하지 않고, getSupportActionBar()를 사용 한 경우. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); try { getSupportActionBar().setDisplayShowHomeEnabled(false); } ca..

[안드로이드] Drawer Icon 색깔 바꾸기

기본이 검정색이다. 흰색 및 다른 색으로 바꾸고 싶다면? 1. 아이콘을 변경 한다. actionBarDrawerToggle.setDrawerIndicatorEnabled(false); Drawable drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_xxx, activity.getTheme()); actionBarDrawerToggle.setHomeAsUpIndicator(drawable); 또는 2. 색을 변경한다.2.1 Style 추가 @android:color/white 2.2 Item 추가@style/DrawerArrowStyle