2
嗨:我想啓動位於連接庫項目中的服務。所有有關的課程都在圖書館中。無法從包含庫的應用程序啓動意圖
的服務是從位於庫的活動名爲:
Intent serviceIntent = new Intent();
serviceIntent.setAction("org.example.library.MY_ACTION");
startService(serviceIntent);
在清單文件 - 既在圖書館和以應用爲它指出:
<service android:name="org.example.library.SomeLibraryClass">
<intent-filter>
<action android:name="org.example.library.MY_ACTION" />
</intent-filter>
</service>
無法啓動服務Intent {act = org.example.android.SomeLibraryClass(has extras)}:找不到
看起來Android似乎在尋找在應用程序中但不在庫中的類。任何人都有過這種行爲?
你的庫添加到您的項目? – Falmarri 2010-08-30 02:28:10
是的。所在的主要活動已成功啓動。但是開始活動的另一個意圖導致了上述結果。 – Sney 2010-08-30 16:45:06