2 Intent Filters, 1 Activity - Which opened it?

穿精又带淫゛_ 提交于 2020-01-30 02:57:08

问题


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.

Thanks!


回答1:


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

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.



来源:https://stackoverflow.com/questions/3380271/2-intent-filters-1-activity-which-opened-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!