android intent 隐式,Android Intent 隐式

1907e0798df5e710f5a1e34cc19e1135.png

AndroidManifest.xml

只有两个同时匹配,才能响应

注:一个活动只能指定一个action,但可以指定多个category

android:name=".SecondActivity"

android:label="SecondActivity"

>

//指定这个活动可以响应的action,ACTION_START

//指定这个活动可以响应的category,一种默认的category

//可指定多个category

java

button_1.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {

//指定要匹配的cation

Intent intent = new Intent("com.example.activitytest.ACTION_START");

//可指定多个category

//intent.addCategory("com.example.activitytest.MY_CATEGORY");

startActivity(intent);

}

});

标签:category,指定,example,intent,ACTION,Intent,Android,隐式

来源: https://www.cnblogs.com/lisztomania/p/12840001.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值