开发者

how to load class from one another application in android

开发者 https://www.devze.com 2023-02-12 02:55 出处:网络
is there anyway to load a class from differen application ? for example, I have two application and one of them has SomeExample class file. and I want to load it and use from another application.

is there anyway to load a class from differen application ?

for example, I have two application and one of them has SomeExample class file. and I want to load it and use from another application.

I try to use, Class.forName. but this function throws "ClassNotFoundExp开发者_运维问答etion".


Is there anyway to load a class from differen application ?

No, sorry.

You can use startActivity(), startService(), and so on to launch components of another application, but each application's code remains separate.


While in most cases unadvisable (Android has many APIs to solve the common problems of inter-app communication without sharing code), it's possible by using PathClassLoader.

See also Android- Using DexClassLoader to load apk file.

0

精彩评论

暂无评论...
验证码 换一张
取 消