Getting started with Android: Toast, Menu usage and destruction of activities

Last: Getting started with Android (3): Basic usage of activities Toast In the previous article onCreate() added some code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.first_layout); Button button1 = (Button) fin ...

Posted on Fri, 14 Feb 2020 20:55:43 -0800 by deathrider

Using Fragment and RadioGroup for page layout switching in Android

Now the main page interface design of APP uses several buttons and different fragments to switch pages. It looks very clear to users at a glance. Here we use fragments and RadioGroup to switch pages. The interface design is as follows: The code is as follows: titlebar.xml(Titlebar Title bar) <?xml version="1.0" encodin ...

Posted on Fri, 14 Feb 2020 08:30:17 -0800 by palpie

Fingerprint identification process of Biometric biometric on Android Q

Part I: Fingerprint HIDL On devices with fingerprint sensors, users can register one or more fingerprints and use them to unlock devices and perform other tasks. Android uses Fingerprint HIDL (hardware interface definition language) to connect to vendor specific libraries and fingerprint hardware (s ...

Posted on Fri, 14 Feb 2020 03:29:22 -0800 by DaiLaughing

Activity managerservice the second lecture: Service startup process

1, Service startup process When we start a Service, we usually call the startService() method or bindService() method. Let's take a look at the flow of these two methods. 1.startService We will first call the startservice () method in Activity. You can see that there is no implementation of the start ...

Posted on Fri, 14 Feb 2020 01:45:24 -0800 by Spikey

How to add an option menu to a clip on Android

I'm trying to add an item to the options menu from a set of clips. I created a new MenuFragment class and extended it to the fragment I want to include the menu item in. This is the code: public class MenuFragment extends Fragment { MenuItem fav; @Override public void onCreate(Bundle savedInstanceState) { super.onCre ...

Posted on Thu, 13 Feb 2020 08:21:11 -0800 by horseygirl

HandlerThread features and source code analysis

HandlerThread generation background Usually we start Thread sub Thread for time-consuming operation, and it is very expensive to create and destroy threads many times. HandlerThread gives us the possibility to execute multiple time-consuming operations serially in the same Thread What is HandlerThread Handler+Thread+Looper i ...

Posted on Thu, 13 Feb 2020 08:12:11 -0800 by Thora_Fan

Basic use of RecycleView and Adapter

1. Create a layout file. Word "fragment" is used to put Recycle and word "fragment" grad "cell is used to put small cells Word? Fragment layout: Word? Fragment? Grad? Cell layout: (card layout) 2. Create the adapter wordFragmentAdapter class package com.example.ngsl.wordFrag ...

Posted on Wed, 12 Feb 2020 10:36:44 -0800 by dlester

Keep / save / restore scroll position when returning to ListView

I have a long ListView where users can scroll before returning to the previous screen. When the user opens this ListView again, I want the list to scroll to the same location as before. Any ideas on how to achieve this? #1 building Warning!! If ListView.getFirstVisiblePosition() is 0, there is an error in the AbsListView that does not al ...

Posted on Tue, 11 Feb 2020 04:02:24 -0800 by ragtek

The android component GridView is simple to use

GridView is basically the same as ListView, except for layout.When we turn on the phone, the app is displayed in a grid called GridView.( As code shows, the adapter uses SimpleAdapter, familiarizes itself with the use of the adapter, and only needs to be aware of a few properties of the GridView. Activity class public cla ...

Posted on Mon, 10 Feb 2020 08:10:30 -0800 by volomike

Summary of factory test application

After yesterday's tiger operation, the demand of the factory finally came to an end, and the new knowledge was summed up If you want to preset two apk s in the launcher, you need to modify the configuration file of the launcher Configure packages / apps / launcher3 / RES / XML / default workspace / 4x4.xml as follows < ...

Posted on Sun, 09 Feb 2020 09:33:31 -0800 by Ramtree