当前位置:网站首页>App Startup
App Startup
2022-06-24 08:23:00 【Sharp surge】
Jetpack New blood ,App Startup One can understand
Examples of use
- Guide pack
dependencies {
api "androidx.startup:startup-runtime:1.0.0"
}
- Create an initialized class implementation
Initializer<Void>Interface
public class PhotoEditorInitializer implements Initializer<Void> {
@NonNull
@Override
public Void create(@NonNull Context context) {
ActivityLifecycle.get().initialize((Application) context);
PhotoEditor.init(context);
DataManager.get().registerContentObserver(context);
return null;
}
@NonNull
@Override
public List<Class<? extends Initializer<?>>> dependencies() {
List<Class<? extends Initializer<?>>> initializerList = new ArrayList<>();
// initializerList.add(ProjectInitializer.class);
return initializerList;
}
}
- stay
AndroidManifest.xmlConfiguration is OK
<!-- Use androidx.startup Framework for automatic initialization -->
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<!-- You can add multiple groups of the following tags , Execute from bottom to top -->
<meta-data
android:name="com.ijoysoft.photoeditor.manager.ProjectInitializer"
android:value="androidx.startup"
tools:node="remove">
<!-- add to tools:node="remove" Not automatically , Manual call required -->
<!--AppInitializer.getInstance(this).initializeComponent(ProjectInitializer.class);-->
</meta-data>
<meta-data
android:name="com.ijoysoft.photoeditor.manager.PhotoEditorInitializer"
android:value="androidx.startup">
</meta-data>
</provider>
author : The Wolf zz
link :https://www.jianshu.com/p/969eee2a641d
source : Simple books
The copyright belongs to the author . Commercial reprint please contact the author for authorization , Non-commercial reprint please indicate the source .
边栏推荐
猜你喜欢

io模型初探

RCNN、Fast-RCNN、Faster-RCNN介绍

WCF TCP protocol transmission
![[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA](/img/a0/f03b8d9c8f5e53078c38cce11f8ad3.png)
[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA

2021-03-11 COMP9021第八节课笔记

The article takes you to understand the security of Windows operating system and protect your computer from infringement

新技术实战,一步步用Activity Results API封装权限申请库

List of Li Bai's 20 most classic poems

C语言_字符串与指针的爱恨情仇

Question bank and simulation examination for operation certificate of refrigeration and air conditioning equipment in 2022
随机推荐
Small sample fault diagnosis - attention mechanism code - Implementation of bigru code parsing
Sql语句内运算问题
软件过程与项目管理期末复习与重点
5分钟,客服聊天处理技巧,炉火纯青
LINQ 查询(2)
Swift 基础 Swift才有的特性
新准则金融资产三分类:AMC、FVOCI和FVTPL
Online education fades
2022年制冷与空调设备运行操作上岗证题库及模拟考试
2021-03-04 comp9021 class 6 notes
Serialization of unity
longhorn安装与使用
VsCode主题推荐
Solution of electric education system for intelligent supervision station
[ACNOI2022]做过也不会
Swift 基础 闭包/Block的使用(源码)
对于flex:1的详细解释,flex:1
你还只知道测试金字塔?
Introduction to software engineering - Chapter 2 - feasibility study
1279_ Vsock installation failure resolution when VMware player installs VMware Tools