当前位置:网站首页>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);
}边栏推荐
- 富文本编辑:wangEditor使用教程
- gorm 之数据插入(转)
- 392. Judgement subsequence
- FS4059C是5V输入升压充电12.6V1.2A给三节锂电池充电芯片 输入小电流不会拉死,温度60°建议1000-1100MA
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- [FAQ] summary of common causes and solutions of Huawei account service error 907135701
- Unity Shader学习(三)试着绘制一个圆
- [matlab] summary of conv, filter, conv2, Filter2 and imfilter convolution functions
- 按照功能对Boost库进行分类
- 瑞吉外卖笔记
猜你喜欢
![递增的三元子序列[贪心训练]](/img/92/7efd1883c21c0e804ffccfb2231602.png)
递增的三元子序列[贪心训练]
![[FAQ] Huawei Account Service Error Report 907135701 Common reasons Summary and Solutions](/img/43/1a9786c89a5ab21d1fb8903cb7b77e.png)
[FAQ] Huawei Account Service Error Report 907135701 Common reasons Summary and Solutions

Unity shader learning (3) try to draw a circle

MySQL8版本免安装步骤教程

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

sharding key type not supported

国内酒店交易DDD应用与实践——代码篇

MySQL之详解索引
![Supprimer les lettres dupliquées [avidité + pile monotone (maintenir la séquence monotone avec un tableau + Len)]](/img/af/a1dcba6f45eb4ccc668cd04a662e9c.png)
Supprimer les lettres dupliquées [avidité + pile monotone (maintenir la séquence monotone avec un tableau + Len)]
![[R language data science]: cross validation and looking back](/img/a8/84a5685ebcb12d3cf8e32e1fbac053.png)
[R language data science]: cross validation and looking back
随机推荐
Apple 5g chip research and development failure: continue to rely on Qualcomm, but also worry about being prosecuted?
【Antd】Antd 如何在 Form.Item 中有 Input.Gourp 时获取 Input.Gourp 的每一个 Input 的value
392. 判断子序列
Basic mode of service mesh
IDEA快捷键大全
The Secretary of Homeland Security warned immigrants "not to embark on a dangerous journey"
Unity Shader学习(三)试着绘制一个圆
Read excel table data
Understand chisel language thoroughly 09. Chisel project construction, operation and testing (I) -- build and run chisel project with SBT
QT how to detect whether the mouse is on a control
基于PaddleX的智能零售柜商品识别
JVM 内存布局详解,图文并茂,写得太好了!
Deming Lee listed on Shenzhen Stock Exchange: the market value is 3.1 billion, which is the husband and wife of Li Hu and Tian Hua
英视睿达冲刺科创板:年营收4.5亿 拟募资9.79亿
qt 怎么检测鼠标在不在某个控件上
FS4059C是5V输入升压充电12.6V1.2A给三节锂电池充电芯片 输入小电流不会拉死,温度60°建议1000-1100MA
德明利深交所上市:市值31亿 为李虎与田华夫妻档
华昊中天冲刺科创板:年亏2.8亿拟募资15亿 贝达药业是股东
[antd step pit] antd form cooperates with input Form The height occupied by item is incorrect
php 日志调试