非常に多くのことを行うサービスのスレッド プールからのスレッドがあります。最後に、プロバイダーにデータを挿入し、ブロードキャストを送信して新しいデータについて GUI に通知します。
多くの場合、1 ~ 3 回のブロードキャストが送受信され、それ以上のブロードキャストは受信されません。スレッドのスタック トレースを見ると、それらはすべて sendBroadcast のシステム メソッドに含まれています。
スレッドを返さないスタックトレース:
BinderProxy.transact(int, Parcel, Parcel, int) 行: 利用不可 [ネイティブメソッド]
ActivityManagerProxy.getProviderMimeType(Uri) 行: 3296
ContextImpl$ApplicationContentResolver(ContentResolver).getType(Uri) 行: 231
Intent.resolveType(ContentResolver) 行: 3754
Intent.resolveTypeIfNeeded(ContentResolver) 行: 3776
ContextImpl.sendBroadcast(Intent) 行: 969
Application(ContextWrapper). sendBroadcast(Intent) 行: 301
受信者登録:
<receiver android:name=".gui.MeasurementReceiver">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="content" android:host="compy.product.providers.measurement"/>
</intent-filter>
</receiver>
ブロードキャスト送信:
context.sendBroadcast(new Intent(android.content.Intent.ACTION_VIEW).
setData(Uri.withAppendedPath(compy.content.Intent.URI_channel, ""+id )));
さて、本当に楽しい部分として、上記はICSを搭載したGalaxy NexusとICS前のGalaxy Noteで問題なく動作します. ただし、Galaxy Note、Galaxy SII、Galaxy SIII with ICS では、説明した方法で失敗します。
Galaxy Nexus に関するおそらく関連するメモでは、プロバイダーは 1 回または 2 回開始されます。問題のある電話では、すべてのクエリが開始されます。この動作の理由も見つかりませんでした。
何か案は?