有没有办法从不同的应用程序加载一个类?
例如,我有两个应用程序,其中一个有 SomeExample 类文件。我想加载它并从另一个应用程序使用。
我尝试使用 Class.forName。但是这个函数抛出“ClassNotFoundExpetion”。
最佳答案
Is there anyway to load a class from differen application ?
不,对不起。
您可以使用 startActivity()
、startService()
等来启动另一个应用程序的组件,但每个应用程序的代码保持独立。
关于java - 如何从android中的另一个应用程序加载类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5065096/