1.这里有两个module,app依赖orcidcardlibrary,但是我想在orcidcardlibrary的activity里传值传到回到app里的activity而不是返回到其他在orcidcardlibrary的activity。
-
这里是我想传值的代码
Intent intent = new Intent("kernal.idcard.ShowResultActivity");
intent.putExtra("recogResult", recogResultString);
if (devcode != null){intent.putExtra("devcode", devcode); intent.putExtra("fullPagePath", picPathString1); intent.putExtra("cutPagePath", picPathString); intent.putExtra("VehicleLicenseflag", VehicleLicenseflag); startActivity(intent);
}
3.尝试过以下方法
隐式调用
Intent intent = new Intent("com.example.administrator.sdktest.ACTION_RESULT");
intent.putExtra("recogResult", recogResultString);
结果:报错
java.lang.RuntimeException: Only one Looper may be created per thread
在app使用startActivityForResult启动orc module里的activity
结果:不理我,还是返回到orc module里其他的activity
主模块依赖子模块,编译的时候主模块可以拿到子模块中的类,但是子模块不能拿到主模块中的类。
举个例子:
Aclass
位于A
模块,BClass
位于B
模块。A
模块添加了B
模块的依赖,就是在A
模块的build.gradle
文件中添加了对B
模块的依赖。而B
模块是没有添加A
模块的依赖的。则现在在
A
模块中,是可以拿到BClass
的,但是在B
模块中拿不到AClass
。回到你的问题上来,你现在是想在依赖的module 中拿到app module 中的Activity,这是拿不到的。
提供给你个思路: