모바일(126)
-
[Android] Constraint Left vs Start , Right vs End
ㅇㅇㅇ Start = Left End = Right but 버튼3 버튼1 버튼2 버튼을 이렇게 배치하고 싶을 때 app:layout_constraintEnd_toEndof = "@+id/버튼2" app:layout_constraintStart_toStartof = "@+id/버튼1" or app:layout_constraintRight_toRightof = "@+id/버튼2" app:layout_constraintLeft_toLeftof = "@+id/버튼1" 이렇게 설정하면 되는데 app:layout_constraintRight_toRightof = "@+id/버튼2" app:layout_constraintStart_toStartof = "@+id/버튼1" 이렇게 섞어서 사용하면 안된다.
2022.03.11 -
[Android] 생명주기 복습
아래 코드는 안드로이드 프레임워크에서 Activity의 상태에 따라 호출하는 대부분의 함수를 나열했다. 각각 로그를 찍어서 각 함수의 실행 순서를 테스트하여 정리한다. public class TestAppActivity extends Activity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("TestAppActivity", "onCreate"); setContentView(R.layout.main); Button btnAuth = (Button) findViewById(R.id.btn_finish); btnAuth..
2022.03.07 -
[Android] ViewModel clear(초기화) 및 데이터가있는 livedata duplicate observe
[Android] ViewModel clear(초기화) 및 데이터가있는 livedata duplicate observe 문제점 블루스 (키보드, 마우스 등)연결시 해당 화면의 onstop ~ onDestroy 안드로이드 생명주기에 따라 실행된다. 이때 ViewModel의 생명주기에 따라 ViewModel은 clear되지 않고 살아있게된다, oncreate에서 viewmodel을 설정하면서 new ViewModelProvider(this, new viewModelProvider.NewInstanceFactory()).get(viewmodel.class) viewmodel store에 존재했던 viewmodel을 가져오게 되는데 기존 livedata에 set했던 데이터들이 남아있게 된다. 그 데이터를 obs..
2022.02.23 -
[Android] 특수문자 제거
trim()과 replaceAll()을 사용하여도 제거되지 않는 특수문자가 있을 경우.. public static String StringReplace(String str){ String match = "[^\uAC00-\uD7A3xfe0-9a-zA-Z\\s]"; str =str.replaceAll(match, ""); return str; } 한글유니코드(\uAC00-\uD7A3), 숫자 0~9(0-9), 영어 소문자a~z(a-z), 대문자A~Z(A-Z), 공백(\s) 를 제외한(^) 단어일 경우 체크 출처:https://jang8584.tistory.com/97
2022.02.16 -
[m1 mac] M1 Mac에서 brew 설치하기
https://im-designloper.tistory.com/53 [M1 MAC] homebrew 설치하기 ( zsh: command not found 오류 해결 ) 새로 m1맥북이 생겨서 개발 환경 세팅 중 homeberw 설치부터 오류가나서 반나절을 다 날려먹으면서 찾게 된 설치 방법을 정리하려고한다. homebrew Mac에서 소프트웨어 패키지를 쉽게 설치하고 관리할 im-designloper.tistory.com 이분꺼로 하니까 됐습니다!
2022.01.22 -
[Android] TabLayoutMediator (tabselectedListener not call + viewPager not changed)
[Android] TabLayoutMediator new TabLayoutMediator(tabLayout, viewPager2, new TabLayoutMediator.TabConfigurationStrategy() { @Override public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) { } }).attach(); 첫번째 인자 Tablayout CustomTabLayout 일 경우에는 this 두번째 인자는 ViewPager 적용순서 ViewPager2의 Adapter를 ViewPager2에 set해준후에 선언해주어야 합니다. 왜냐하면 attach()메소드 내에서 adapter = viewPager.getAdapter() 라는 ..
2022.01.07