今天学习了As中的显隐式Intent
三种构建方式:
在Intent的构造函数中指定
调用意图对象的setClass方法指定
调用意图对象的setComponent方法指定
(1)
Intent intent = new Intent(MainActivity.this, MainActivity2.class);
(2)
Intent intent = new Intent(); intent.setClass(MainActivity.this,MainActivity2.class);
(3)
Intent intent = new Intent(); ComponentName componentName = new ComponentName(MainActivity.this,MainActivity2.class); intent.setComponent(componentName);
标签:MainActivity2,每日,2023,MainActivity,intent,new,Intent,随笔,class From: https://www.cnblogs.com/JJTyyds/p/17195485.html