Month: December 2019

Android Activity Life-cycle

First opens Activity: onCreate(),OnStart(),onResume() User Clicks backButton(): onPause(),onStop(),onDestroy() Navigating to another screen: First Screen:: onPause(),onStop() Second Screen: onCreate(),OnStart(),onResume() Presses Backbutton in Activity2: Second Screen: onPause(),onStop() ,onDestroy() First Screen: onRestart(), onStart(), onResume() User locks the device: onPause(),onStop() Again Opens lock: onRestart(), onStart(), onResume()

RecycleView steals focus when inside a NestedScrollView

Reference Link: https://stackoverflow.com/questions/36923948/recycleview-steals-focus-when-inside-a-nestedscrollview add this two line of code in parent or root viewgroup: <android.support.v4.widget.NestedScrollView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent””> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:focusableInTouchMode=”true” android:orientation=”vertical”> <View android:id=”@+id/someView” android:layout_width=”wrap_content” android:layout_height=”350dp”/> <android.support.v7.widget.RecyclerView android:id=”@+id/recyclerView” android:layout_width=”match_parent” android:layout_height=”wrap_content”/> </LinearLayout> </android.support.v4.widget.NestedScrollView>

file was loaded in the wrong encoding android studio windows

Reference Link: https://stackoverflow.com/questions/53249677/android-studio-shows-wrong-file-contents/54509482#54509482 Thanks to the Answer of Asim, I found deleting folder caches fixed the problem for my case (all gradle files in Android Studio show contents that have nothing to do with the actual contents of these files): Delete caches folder.then you are good to go. C:\Users\my_user_name\.AndroidStudio3.3\system\caches