2意图过滤器,1个活动 - 这打开了它? [英] 2 Intent Filters, 1 Activity - Which opened it?

查看:99
本文介绍了2意图过滤器,1个活动 - 这打开了它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法知道哪些意图过滤器负责启动其在AndroidManifest.xml中定义了两个意向过滤器的活动?我希望有一个略有不同的逻辑,但还不够,应该需要一个全新的活动。

Is there a way to know which Intent Filter is responsible for launching an Activity which has two Intent Filters defined in AndroidManifest.xml? I want a slightly different set of logic, but not enough that should require a whole new Activity.

谢谢!

推荐答案

没关系,发现了它。只是不看够硬...

Never mind, found it. Just wasn't looking hard enough...

使用 this.getIntent()的getAction()在你的活动会吐出正是我一直在寻找,一个字符串,以确定哪些意向筛选器操作打开了它。

Using this.getIntent().getAction() in your Activity will spit out exactly what I was looking for, a String to identify which Intent Filter Action opened it.

这篇关于2意图过滤器,1个活动 - 这打开了它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆