当前位置:网站首页>Use of arouter
Use of arouter
2022-07-04 14:16:00 【Novice Xiaowang】
One for help Android App The framework for component transformation Support routing between modules 、 signal communication 、 decoupling
1. Basic use :
defaultConfig {
applicationId "com.example.greendao"
minSdk 29
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
To configure
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}dependencies {
implementation 'com.alibaba:arouter-api:1.5.2'
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'}2. initialization
stay application in
ARouter.init(this);
3. Use
It's about to jump activity On the configuration Route annotation
@Route(path = "/test/MainActivity2")
Jump code
ARouter.getInstance().build("/test/MainActivity2") The interface to jump to
.withString("name","eeeeee")
.withString("age","30").navigation(); Parameters carried 4. Data analysis Automatic data injection
@Route(path = "/test/MainActivity2")
public class MainActivity2 extends AppCompatActivity {
@Autowired(name = "name")
String name;
@Autowired(name = "age")
String age;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
ARouter.getInstance().inject(this);
Log.e("MainActivity2",name+age);
}边栏推荐
- 海外游戏代投需要注意的
- 英视睿达冲刺科创板:年营收4.5亿 拟募资9.79亿
- FS4059C是5V输入升压充电12.6V1.2A给三节锂电池充电芯片 输入小电流不会拉死,温度60°建议1000-1100MA
- Ws2811 m is a special circuit for three channel LED drive and control, and the development of color light strip scheme
- Secretary of Homeland Security of the United States: domestic violent extremism is one of the biggest terrorist threats facing the United States at present
- 程序员的焦虑
- BLOB,TEXT GEOMETRY or JSON column 'xxx' can't have a default value query 问题
- 【FAQ】華為帳號服務報錯 907135701的常見原因總結和解决方法
- Install and use MAC redis, connect to remote server redis
- go vendor 项目迁移到 mod 项目
猜你喜欢

Mask wearing detection based on yolov1

Haobo medical sprint technology innovation board: annual revenue of 260million Yonggang and Shen Zhiqun are the actual controllers

sharding key type not supported

Qt如何实现打包,实现EXE分享

205. 同构字符串

Install MySQL

C# wpf 实现截屏框实时截屏功能

Apple 5g chip research and development failure: continue to rely on Qualcomm, but also worry about being prosecuted?

Understand chisel language thoroughly 12. Chisel project construction, operation and testing (IV) -- chisel test of chisel test

【Matlab】conv、filter、conv2、filter2和imfilter卷积函数总结
随机推荐
数据仓库面试问题准备
Understand chisel language thoroughly 04. Chisel Foundation (I) - signal type and constant
Basic mode of service mesh
IDEA快捷键大全
海外游戏代投需要注意的
Understand chisel language thoroughly 05. Chisel Foundation (II) -- combinational circuits and operators
学内核之三:使用GDB跟踪内核调用链
華昊中天沖刺科創板:年虧2.8億擬募資15億 貝達藥業是股東
sharding key type not supported
Understand chisel language thoroughly 10. Chisel project construction, operation and testing (II) -- Verilog code generation in chisel & chisel development process
JVM 内存布局详解,图文并茂,写得太好了!
中邮科技冲刺科创板:年营收20.58亿 邮政集团是大股东
gorm 之数据插入(转)
Unity shader learning (3) try to draw a circle
基于PaddleX的智能零售柜商品识别
Read excel table data
吃透Chisel语言.11.Chisel项目构建、运行和测试(三)——Chisel测试之ScalaTest
R语言使用dplyr包的mutate函数对指定数据列进行标准化处理(使用mean函数和sd函数)并基于分组变量计算标准化后的目标变量的分组均值
硬件基础知识-二极管基础
卷积神经网络经典论文集合(深度学习分类篇)