当前位置:网站首页>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);
}
边栏推荐
- Common content type correspondence table
- 测试流程整理(3)
- 吃透Chisel语言.09.Chisel项目构建、运行和测试(一)——用sbt构建Chisel项目并运行
- Ws2811 m is a special circuit for three channel LED drive and control, and the development of color light strip scheme
- 2022 practice questions and mock exams for the main principals of hazardous chemical business units
- R语言dplyr包summarise_if函数计算dataframe数据中所有数值数据列的均值和中位数、基于条件进行数据汇总分析(Summarize all Numeric Variables)
- 按照功能对Boost库进行分类
- Assertion of unittest framework
- Understand chisel language thoroughly 05. Chisel Foundation (II) -- combinational circuits and operators
- Why should Base64 encoding be used for image transmission
猜你喜欢
富文本编辑:wangEditor使用教程
MATLAB中tiledlayout函数使用
锐成芯微冲刺科创板:年营收3.67亿拟募资13亿 大唐电信是股东
Apple 5g chip research and development failure: continue to rely on Qualcomm, but also worry about being prosecuted?
Xcode 异常图片导致ipa包增大问题
The font of markdown grammar is marked in red
Mask wearing detection based on yolov1
Understand chisel language thoroughly 11. Chisel project construction, operation and test (III) -- scalatest of chisel test
MySQL8版本免安装步骤教程
MySQL5免安装修改
随机推荐
Fs4059c is a 5V input boost charging 12.6v1.2a. Inputting a small current to three lithium battery charging chips will not pull it dead. The temperature is 60 ° and 1000-1100ma is recommended
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
Unity Shader学习(三)试着绘制一个圆
按照功能对Boost库进行分类
R语言ggplot2可视化:gganimate包创建动态折线图动画(gif)、使用transition_reveal函数在动画中沿给定维度逐步显示数据
测试流程整理(3)
R语言使用dplyr包的mutate函数对指定数据列进行标准化处理(使用mean函数和sd函数)并基于分组变量计算标准化后的目标变量的分组均值
IDEA快捷键大全
Why should Base64 encoding be used for image transmission
吃透Chisel语言.10.Chisel项目构建、运行和测试(二)——Chisel中生成Verilog代码&Chisel开发流程
Understand chisel language thoroughly 09. Chisel project construction, operation and testing (I) -- build and run chisel project with SBT
markdown 语法之字体标红
学内核之三:使用GDB跟踪内核调用链
【FAQ】華為帳號服務報錯 907135701的常見原因總結和解决方法
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
Programmer anxiety
Golang 使用 JSON unmarshal 数字到 interface{} 数字变成 float64 类型(转)
10.(地图数据篇)离线地形数据处理(供Cesium使用)
MongoDB常用28条查询语句(转)
软件测试之测试评估