Android app的activity如何被另一个app打开

一个app打开另一个app的指定activity时,可能报错未在Manifest.xml文件中注册。这可能是因为在manifest清单文件中注册activity时,没有设置字段exported。


这里只需添加 字段android:exported="true"就可以。

另外,在使用ComponentName类设置包名和类名参数时,注意,一定要把activity所在的包的完整路径名作为参数写入。

猜你喜欢

转载自blog.csdn.net/frank_develpoer/article/details/53693795