
switch 문에서 case R.id.xxxx 를 더 이상 제공 하지 않는다고 한다. 간단하게 if else 문으로 대체 하면 되는데 case 문이 많을 경우 난감하고 귀찮다. 이럴 때는 간단히 Refactoring 을 하면 된다. switch 에 커서를 올리고 Option(Windows Alt) + enter 를 치고 Replace switch with if 를 선택하면 한 방에 해결 된다.

위와 같이 아래 영역을 넘어가게 되어 하단에 버튼등을 고정 시킬 경우 보이지 않는 문제가 발생한다. 1. viewpager의 marginBottom="?actionBarSzie" 로 하게 될 경우 버튼은 보이지만 스크롤 할 경우 같이 올라가며 하단 빈 영역이 보이게 된다. 2. Tab과 CollapsingToolbarLayout 를 사용 할 경우 다른 레이아웃으로 감싸주면 스크롤 범위가 영역과 맞아져저 해결은 되지만, 탭의 구성이 찌그러지게 된다. 즉, CoordinatorLayout 아래 다른 레이아웃으로 감싸면 안됨. 3. 원인은 app:layout_behavior="@string/appbar_scrolling_view_behavior" 뷰 페이저의 스크롤링을 적용했기 때문에 하단으로 더 길게 스크롤..
아래 코드를 navController = Navigation.findNavController(this, R.id.fragment_navi_dashboard_host); 요렇게 바꾸어야 함 NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager() .findFragmentById(R.id.fragment_navi_dashboard_host); NavController navController = navHostFragment.getNavController();
벡터 문제도 아니고, xml 문제도 아니고, gradle 문제도 아니면, context 문제다. Drawable drawable = ContextCompat.getDrawable(getApplicationConetxt(), R.drawable.ic_arrow_back_white_24dp); 아래와 같이 this 로 바꿔야 한다. Drawable drawable = ContextCompat.getDrawable(this, R.drawable.ic_arrow_back_white_24dp);
Drawable drawable = ContextCompat.getDrawable(getApplicationContext(),R.drawable.ic_arrow_back_white_24dp); Overflow 아이콘 변경 toolbar.setOverflowIcon(drawable); 햄버거 모양 아이콘 변경 actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(true); Drawable drawable = ContextCompat.getDrawable(mContext,R.drawable.ic_arrow_back_white_24dp); actionBar.setHomeAsUpIndicator(drawable); 액티비티..
ERROR: Failed to parse XML in /User/,,,,,,,,AndroidManifest.xmlParseError at [row,col]:[310,9]Message: expected start or end tagAffected Modules: app xml 경로가 길어서 끝까지 보지 못하는 경우가 있다.이 에러는 AndroidManifest 310 라인을 보시오. 주석이 혼자 놀고 있을 수 있으니. build.gradle 문제가 아니오.
findViewHolderForAdapterPosition 을 써서 holder 의 itemView를 얻어 올 수 있는 방법이 있다. 즉, 예전 listView의 경우 해당 아이템을 가져와서 크기를 측정(itemView.measure) 한 뒤 리스트의 상단에서 그 아이템 위치 까지 높이를 만들어서 갔었는데, reclyerView에서는 이런 작업을 할 경우, 리스트가 notifychanged 를 하면서 null 이 떨어 질 수 있다. null 을 피하기 위해선 많은 방법을 사용 해야 한다. LinearLayoutManager linearLayoutManager = (LinearLayoutManager)recyclerView.getLayoutManager(); if(linearLayoutManager != ..
프레그먼트 생명 주기 실행 시onAttach —> onCreate() —> onViewCreated() —> onActivicyCreated() —> onResume() 해제시onPause() — > onDestroyView() — > onDestroy() —> onDetach() 즉,안전하게 context 를 사용 하려면 @Override public void onAttach(Context context) { super.onAttach(context); mContext = context; } 요렇게 해서 사용한다.프래그먼트 이곳 저곳에서 getContext(), getActivity() 를 부르다가 Null 이 발생할 수 있기 때문에 이렇게 부르는 것이 안전. 더 안전 하려면 부를 때마다 체크 하는게 ..