Fragment’s two jump methods, with theories and examples

Jump to multiple Fragments Many software nowadays involve switching between multiple pages. Here you can use Fragment to do it. If you use Fragment to achieve this effect, there will be a problem. Then how to switch between multiple Fragments. Here is an introduction to Fragment There are two switching methods, In Android, there are […]

Hyper-V installs Centos + configures Centos repo + solves the problem of wifi connection and fixed IP access to Cetos + other fragmentary issues + remote access (reprinted + modified version + supplementary version of the problem + supplementary part)

In the past year or two, I have been using a laptop provided by the company. Due to security restrictions, I cannot install some virtual machine software, which makes me always feel troublesome during the learning process. Therefore, I have always wanted to try a free virtual machine software, using Windows The built-in service Hyper-V […]

The new version of jetpack navigation2.5.3 returns repeated creation of fragments

When navigation returns, it will re-create the version of the fragment before 2.3.5, most of the modifications (the new version is invalid): override fun navigate( destination: Destination, args: Bundle?, navOptions: NavOptions?, navigatorExtras: Navigator.Extras? ): NavDestination? { if (mFragmentManager.isStateSaved) { Log.i( TAG, “Ignoring navigate() call: FragmentManager has already” + “saved its state” ) return null } […]

How much do you know about the life cycle of Fragment?

Fragment life cycle Fragment is a component used to build user interfaces in Android. Fragment has its own life cycle, including the following stages: onAttach(): Called when a Fragment is associated with an Activity. You can obtain a reference to the associated Activity through this method. onCreate(): Called when a Fragment is created, it can […]

Spring-Boot implements HTTP large file breakpoint resumable download in fragments

How does the server segment a large video file and respond to the client in segments so that the browser can play it progressively. Spring Boot implements HTTP fragmented download breakpoint resuming, thereby solving the problem of large video playback on H5 pages, and achieving progressive playback. Only the content that needs to be played […]

Fragment nested TabLayout and ViewPager

Table of Contents Rendering: Main page layout: —Bottom navigationbottomnavigation– menu.xml: Click the navigation to jump to each Fragment: Nested Tablayout + sub-Fragment + ViewPager in Fragment Page Layout: Summary of premise: Components: Linkage: Idea: New_Fragment + MainActivity.java source code: The layout file is not released yet, the code file is for reference only Rendering: Main […]

MyBatis dynamic statements where/if, set, trim, choose/when/otherwise, foreach tag, and sql fragments

1. Environment preparation 1. Prepare the database and insert data CREATE TABLE `t_emp` ( emp_id INT AUTO_INCREMENT, emp_name CHAR(100), emp_salary DOUBLE(10, 5), PRIMARY KEY (emp_id) ); INSERT INTO `t_emp`(emp_name,emp_salary) VALUES(“tom”,200.33); INSERT INTO `t_emp`(emp_name,emp_salary) VALUES(“jerry”,666.66); INSERT INTO `t_emp`(emp_name,emp_salary) VALUES(“andy”,777.77); 2. Write entity classes package com.suchuanlin.pojo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class […]

Best way to communicate between Fragments

In Android applications, fragments are components used to build flexible and reusable user interfaces. However, when multiple fragments are used in an application, communication between them becomes very important. This article will introduce how to implement communication between fragments and between fragments and host activities in Android applications. Use ViewModel for communication ViewModel is an […]

[Redis] Redis memory fragmentation: in-depth analysis and optimization strategies

This article has been included in GitHub. Recommended reading: Java Random Notes WeChat public account: Java Caprice It is not easy to be original, so pay attention to copyright. Please indicate the original author and original link when reprinting Article directory How memory fragmentation occurs memory allocator How to check if there is memory fragmentation […]