概述
在将工程A作为依赖import module 工程B中,想使用A中的方法Intent跳转到B中的类中的时候,使用intent(contxt,class)的时候,会发现目的class是找不到的。
解决方法 ##
假如目的class为B中的b类,A中的a类为始发地
我们需要做的步骤如下:
在AndroidManifest.xml文件中找到b类的所在配置清单文件,然后加入action
<intent-filter >
<action android:name="com_demo"></action>
<category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>跳转方法使用:
Intent intent=new Intent("com_demo");
startActivity(intent);