LiveData overview, kotlin interview questions
Typically, LiveData provides updates only when the data changes and only when the observer is active.
An exception to this behavior is that observers also receive updates when they change from inactive to active.
In addition, if the observer changes from inactive to active for the second time, it will receive an update only if the value has c ...
Posted by Anim9or on Fri, 03 Sep 2021 20:20:09 -0700
RecyclerView event distribution principle, practical analysis, Android interview questions
Recently, when solving the problem of RecyclerView sliding conflict, we encountered a scenario where the problem cannot be solved by using OnItemTouchLister. This article will focus on the following problems in combination with actual cases:
Brief analysis of RecyclerView event distribution execution process Why can't adding OnItemTouchListe ...
Posted by jeaker on Thu, 02 Sep 2021 21:29:51 -0700
VirtualAPK detailed explanation and use, really cow
3.1 basic principles
ClassLoader that combines host and plug-in It should be noted that classes in plug-ins cannot be duplicated with the hostMerge plug-in and host resources Reset the packageId of the plug-in resource and merge the plug-in resource and the host resourceRemove the reference of the plug-in package to the host During constructi ...
Posted by mospeed on Thu, 02 Sep 2021 18:31:29 -0700
Android learning notes: UI controls and layout
1. Common properties of view class: android:id sets the identifier of the control android:layout_width sets the layout width of the subcomponent android:layout_height sets the layout height of the subcomponent android:background sets the background color of the control android:onClick sets the click event binding listener for the control androi ...
Posted by dagee on Thu, 02 Sep 2021 15:06:42 -0700
Android advanced - Binder of Android cross process communication mechanism, successfully joined Tencent
Through system call, user space can access kernel space. How does it access kernel space? The dynamic loadable kernel module mechanism of Linux solves this problem. The module is a program with independent functions. It can be compiled separately, but it can not run independently. In this way, the Android system can complete the communication b ...
Posted by Lillefix on Thu, 02 Sep 2021 00:14:46 -0700
Architecture e e-commerce APP Componentization Exploration, Shock
When isModuleRun is false, both Application and AndroidManifest participate in the compilation as Libraries, which do not require Activation to be started and custom Applications to be inverted.
isModuleRun=false
Unordered modification
<application
android:allowBackup="true"
android:supportsRtl="true"
android:theme="@style/App ...
Posted by Mark on Wed, 01 Sep 2021 20:45:55 -0700
Android source code - an article takes you to understand OkHttp. It's too complete
if (retryAndFollowUpInterceptor.isCanceled()) {
signalledCallback = true;
responseCallback.onFailure(RealCall.this, new IOException("Canceled"));
} else {
signalledCallback = true;
responseCallback.onResponse(RealCall.this, response);
}
} catch (IOException e) {
if (signalledCallback) {
// Do not ...
Posted by rfigley on Wed, 01 Sep 2021 18:07:57 -0700
References in Java and JNI (strong, soft, weak, virtual)
1. Strong References (Objects)
Features:
Strong references provide direct access to the target object.
Will not be recycled.
Two, soft reference (SoftReference class)
Features:
When GC reclaims based on JVM memory, JVM reclaims when it finds it is out of memory
Conditions for freeing up space: JVM found insufficient m ...
Posted by alireza on Sun, 19 Jul 2020 08:34:35 -0700
Shake like WeChat
Shake function
1. Get Sensor Management Classes
SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
2. Inherit the SensorEventListener interface and override sensor listening methods
@Override
public void onSensorChanged(SensorEvent event) {
/**
* 1,Get the sensor type ( ...
Posted by thomasadam83 on Sat, 18 Jul 2020 09:06:41 -0700
Dynamically set the width and height of the imageview in HorizontalScrollView
The demand is as follows:
There are two kinds of pictures to display, one is 640*640 and the other is 1920*1080.
If it is a 1920 picture, you need to double-click to switch the display mode. By default, the middle part of 1920 is displayed by 640*640, which allows you to swipe left and right to view the entire picture ...
Posted by greenie__ on Fri, 17 Jul 2020 08:38:57 -0700