0
我试图在我从主应用程序导入的模块上启动活动。 什么都没有发生。没有崩溃,也没有发射。这是我在我的主要的应用程序代码:从主应用程序启动活动模块Android
Intent moduleActivity = new Intent("com.service.ModuleActivity");
startActivity(moduleActivity);
这里是模块清单:
<application
android:allowBackup="true"
android:supportsRtl="true"
android:largeHeap="true"
android:persistent="true" >
<activity android:name="com.service.ModuleActivity"
android:screenOrientation="landscape"
android:launchMode="singleTask">
<intent-filter>
<action android:name="com.service.ModuleActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
我没有崩溃和调试Intent moduleActivity
不null
我错过了什么?
开发嗨,试图取代线意图moduleActivity =新意图( “com.service.ModuleActivity”); with Intent moduleActivity = new Intent(context,ModuleActivity.class); –
一个参数Intent构造函数用于指定一个操作,如VIEW。你不用它来指定一个类名。 –
@RishabhBhatia新Intent(context,ModuleActivity.class)也没有发生; – DevAndroid