安卓:动态asscociating数据类型与活动 [英] Android: Dynamically asscociating data type with an activity

查看:128
本文介绍了安卓:动态asscociating数据类型与活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用例在我的应用程序,其中,后某一点,我需要的数据与活动相关联。所以每当意图与动作和数据类型被解雇了,我的行为可以被打开。我知道,它可以将一个数据类型与通过的Andr​​oidManifest.xml活性静态关联。

是否有可能和动态编程寄存器中的数据类型的活动? 任何指针是AP preciated。

解决方案
  

是否有可能和动态编程注册活动的数据类型?

没有。

如果在<你要事先知道,但你只想要一个特定点后启用该功能,您可以实现这一点;意向滤光器&gt通过<以活动为别名> (有它在一开始就被禁用,并通过 PackageManager 启用它编程)。唉,<意向滤光器> 没有出现的东西,你可以启用或禁用,至少根据我的清单文件中看到

I have a use case in my application, where after certain point, I need to associate an data with an activity. So whenever an intent with an action and the data type is fired, my activity can be opened. I know that it is possible to associate a data type with an activity statically via AndroidManifest.xml.

Is it possible to register the data type for an activity dynamically and programatically ? Any pointers are appreciated.

解决方案

Is it possible to register the data type for an activity dynamically and programatically ?

No.

If the <intent-filter> you want is known in advance, but you only want to enable it after a certain point, you may be able to achieve this via <activity-alias> (have it disabled at the outset and enable it programmatically via PackageManager). Alas, <intent-filter> does not appear to be something you can enable or disable, at least based on what I see in the manifest documentation.

这篇关于安卓:动态asscociating数据类型与活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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