没有在Android上的清单文件中声明它打开活动? [英] Open an activity without declaring it in the manifest file in ANDROID?

查看:207
本文介绍了没有在Android上的清单文件中声明它打开活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开一个活动没有在清单文件中声明它。
我不知道是否有可能或没有。
我其实想要的是从使用意图我的程序动态打开活动。
谁能帮我,如果它是可能的。

I want to open an activity without declaring it in an manifest file. I don't know if it is possible or not. What I actually want is to dynamically open an activity from my program using intents. Can anyone help me if it is possible.

推荐答案

不可能的。虽然我不能确定你的意思动态打开活动。

Not possible. Although I am unsure what you mean "dynamically open an activity".

请参阅: http://developer.android.com/reference/android/应用程序/ Activity.html

在类概述它指出:为了与Context.startActivity()的使用,所有的活动课,必须有相应的声明,在其包装的Andr​​oidManifest.xml

Under Class Overview it states "To be of use with Context.startActivity(), all activity classes must have a corresponding declaration in their package's AndroidManifest.xml"

您可以有一个活动在你的包,并在清单中不是定义它,但你将无法成功启动了。

You can have an Activity in your package and not define it in the manifest, however you would not be able to start it successfully.

这篇关于没有在Android上的清单文件中声明它打开活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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