[問題] 如何包一個有做連接service的aar?
弄了一天,上來求救一下..
我這邊包了一個AAR,AAR裡面有一個class 名叫 RwmManager
class CwmManager exteds Activity
{
public void Create(){
Intent adc = new Intent(this, rwm.wearablesdk.wearableService.class)
/*
bindService(....)
*/
}
}
AndroidManifest.xml:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
<service
android:name="rwm.wearablesdk.WearableService"
android:enabled="true" />
</application>
包成AAR後,給另一個 project import
在別的 project 的 activity 這樣宣告
RwmManager rwmManager = new RwmManager();
rwmManager.Create();
APK會變成閃退,log出現
E AndroidRuntime: at rwm.wearablesdk.RwmManager.Create(Unknown Source)
他好像找不到 rwm.wearablesdk.WearableService...
我在另一個 project 的AndroidManifest.xml加上此rwm.wearablesdk.WearableService
一樣結果
我錯在哪呢? 感謝
如果不會在閃退了,我想要在此RwmManager class 內 bindService 這邏輯不知道
有沒有問題,因為我看範例都是在Activity 去 bindServiec,而我是想把 RwmManager
extends Activity 包起來給別人呼叫,當一呼叫 WearableService就已被連接了
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.220.69.181
※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1504604018.A.5E4.html
→
09/05 17:45, , 1F
09/05 17:45, 1F
→
09/05 17:47, , 2F
09/05 17:47, 2F
→
09/05 17:47, , 3F
09/05 17:47, 3F
→
09/05 17:47, , 4F
09/05 17:47, 4F
→
09/05 17:47, , 5F
09/05 17:47, 5F
→
09/05 17:50, , 6F
09/05 17:50, 6F
→
09/05 17:52, , 7F
09/05 17:52, 7F
→
09/05 17:54, , 8F
09/05 17:54, 8F
→
09/05 17:54, , 9F
09/05 17:54, 9F
→
09/05 17:54, , 10F
09/05 17:54, 10F
→
09/05 17:54, , 11F
09/05 17:54, 11F
→
09/05 17:56, , 12F
09/05 17:56, 12F
→
09/05 18:12, , 13F
09/05 18:12, 13F
→
09/05 18:13, , 14F
09/05 18:13, 14F
→
09/05 18:22, , 15F
09/05 18:22, 15F
→
09/05 18:22, , 16F
09/05 18:22, 16F
→
09/05 18:23, , 17F
09/05 18:23, 17F
→
09/05 21:33, , 18F
09/05 21:33, 18F
→
09/05 21:34, , 19F
09/05 21:34, 19F
→
09/05 21:35, , 20F
09/05 21:35, 20F
→
09/05 21:37, , 21F
09/05 21:37, 21F
→
09/06 02:15, , 22F
09/06 02:15, 22F
→
09/06 02:15, , 23F
09/06 02:15, 23F
→
09/06 02:16, , 24F
09/06 02:16, 24F
→
09/06 02:17, , 25F
09/06 02:17, 25F
→
09/06 02:17, , 26F
09/06 02:17, 26F
→
09/06 02:20, , 27F
09/06 02:20, 27F
→
09/07 21:34, , 28F
09/07 21:34, 28F
→
09/07 21:34, , 29F
09/07 21:34, 29F
→
09/07 21:34, , 30F
09/07 21:34, 30F
→
09/08 00:48, , 31F
09/08 00:48, 31F
→
09/08 00:49, , 32F
09/08 00:49, 32F
→
09/08 22:33, , 33F
09/08 22:33, 33F
→
09/08 22:33, , 34F
09/08 22:33, 34F
→
09/08 22:33, , 35F
09/08 22:33, 35F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
AndroidDev 近期熱門文章
PTT數位生活區 即時熱門文章