본문 바로가기
[Coroutine] Coroutine context and dispatchers https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/coroutine-context-and-dispatchers.md#thread-local-data -기존에 있었던 doc 이 update 되어서 따로 정리한다. Coroutine context and dispatchers -Coroutine 은 항상 어떤 context 하에서 실행된다.이 context 는 CoroutineContext type 을 가지며 Kotlin standard lib 에 정의되어 있다. -Coroutine context 는 여러개의 element 들을 가진 set 이다.main element 는 coroutine 의 Job, dispatcher 이다. Dispatchers.. 2019. 2. 8.
[android] AAC 로 app 의 background, foreground 상태 알기 https://medium.com/@arturogdg/background-and-foreground-events-with-android-architecture-components-233fdd9fa855https://developer.android.com/reference/android/arch/lifecycle/Lifecycle -build.gradle 에 아래것을 추가한다.kapt "android.arch.lifecycle:compiler:1.1.1"implementation "android.arch.lifecycle:extensions:1.1.1” -background, foreground state detection 을 위해 아래 클래스를 생성한다.class ApplicationObserver : .. 2018. 11. 24.
[android] Fragment 와 함께라면 Configuration Change 가 무섭지 않아. [android] Fragment 와 함께라면 Configuration Change 가 무섭지 않아. -애석하게도 대부분의 개발자들이 manifest 에 configChanges 속성을 통해 orientation 값만 설정해주면 모든게 해결되는 줄 안다. 하지만 그렇지 않다. Configuration Change 는 여러 경우에 발생된다. 기본적으로 configChanges 에 들어가는 값들의 상황이 그렇고, 언어가 변경되거나, dock 에 연결되거나, font 크기가 바뀌거나 등의 조건으로 destroy-recreate 되곤 한다. 또한 리소스, 메모리 관리 측면에서 Activity 가 destroy 되고 create 되도록 하는 것이 좋다. - 예전부터 개발을 해온 사람이라면 Activity 에 on.. 2016. 10. 12.
[android] Activity Configuration Change Simulation. [android] Activity Configuration Change Simulation. https://developer.android.com/reference/android/app/Activity.html#recreate%28%29 Activity 의 recreate() 함수를 호출하면 된다. public void recreate ()Added in API level 11Cause this Activity to be recreated with a new instance. This results in essentially the same flow as when the Activity is created due to a configuration change -- the current instance w.. 2015. 12. 14.
[android] login button facebook doesn't work after coming back from the login page. [android] login button facebook doesn't work after coming back from the login page. keypoint is onActivityResult. public class MainFragment extends Fragment{ private static final String TAG = "MainFragment"; private UiLifecycleHelper uiHelper; @Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);uiHelper = new UiLifecycleHelper(getActivity(), callback);uiH.. 2014. 5. 14.
[android air] Activity lifecycle on the flash ( onResume, onPause, onStart, onStop ) [android air] Activity lifecycle on the flash ( onResume, onPause, onStart, onStop ) NativeApplication.nativeApplication.addEventListener( Event.ACTIVATE, onStart );NativeApplication.nativeApplication.addEventListener( Event.DEACTIVATE, onStop ); function onStart( e : Event ){// Do sth..} function onStop ( e : Event ){// Do sth..} activate, addEventListener, android activity lifecycle, Callback,.. 2014. 5. 7.
반응형