분류 전체보기(229)
-
[Android] onNewIntent, onSaveInstanceState
※ onNewIntent() 메서드란? 액티비티가 새로 만들어지지 않고 재사용될 경우 액티비티의 onCreate() 메서드가 호출되지 않습니다. 이러한 이유 때문에 재사용되는 액태비티에서 인텐트를 전달 받아 처리하는 방법이 따로 있어야 하는데 그때 사용 하는것이 onNewIntnet() 메서드 입니다. 파라미터 값으로 인텐트를 받습니다. onNewIntent(Intent intent) onNewIntent(Intent intent) 메서드를 사용하면 액티비티를 재사용 했어도 인텐트 객체를 전달받을 수 있습니다. ※ onSaveInstanceState() 메서드란? 액티비티가 중지되기 전에 호출되는 메서드. 데이터를 임시로 저장할 수 있습니다. 파라미터 값으로 bundle을 사용합니다. onSaveInst..
2021.03.10 -
AndroidManifest.xml receiver tag is incompatible with attribute description (attr) reference.
가 있으니 is incompatible with attribute description (attr) reference. 오류났음 -->
2021.03.08 -
DataBinding – Two-way(양방향) Databinding with Custom View
DataBinding – Two-way(양방향) Databinding with Custom View CustomView가 아닌 일반적인 방법 android:text="@={viewModel.mContent} CustomView CustomView에 양방향 데이터 바인딩을 적용하려면 꽤 복잡하다. customview에 적절한 변수값 선언하기 CustomView 클래스에 Databinding 연결하기 constructor( context: Context, attrs: AttributeSet?, defStyleAttr: Int ) : super(context, attrs, defStyleAttr) { initView() } /** * init View Here */ private fun initView() {..
2021.03.04 -
[android] theme, attr, style, color ,values 정리
스타일과 테마 테마 != 스타일 스타일 스타일은 view attribute(뷰 속성)의 모음입니다. 스타일을 Map라고 생각해도 됩니다.. key들은 View attribute들이에요. 예를 들어 widget에 선언되는 속성들, 즉 layout파일에 선언된 것들이요. 스타일은 한 타입의 widget을 나타냅니다. 테마 테마는 style과 layout 등에 적용될 수 있는 리소스들의 집합니다. 앱 전체적으로 적용되는 리소스의 집합을 일컫습니다. 테마는 interface(인터페이스)와 비슷 attr 사용법 1. Custom Attribute 사용 Custom Widget에 자신의 Attrs를 설정하고 싶을 경우가 있다. 다음과 같은 순서로 진행하면 사용할 수 있다. attrs.xml에 사용자 속성 정의 - ..
2021.02.26 -
TabLayout Custom View View 안에있는 TextView Selected 안될때 해결법!
TabLayout Custom View View 안에있는 TextView Selected 안될때 해결법! 해결법 xml drawable/tab_title_color Layout/design_tab_button.xml 자바코드 for(int i=0; i
2021.02.25 -
[안드로이드] You need to use a Theme.AppCompat theme (or descendant) with this activity
안드로이드 TabLayout 사용도중 Error Infalting 오류가 발생했습니다 ㅠㅠ java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.범인은.. Tablayout클래스의 내용문에 있었습니다. android.support.v7.appcompat.R.styleable.textApperance ... 다른 방법으로는 AndroidManifest.xml에서 문제가 발생한 Activity를 아래와 같이 바뀌면 에러가 발생하지 않습니다.
2021.02.25