メイン アクティビティと別のクラスに情報を送信するサービスに、暗黙のインテントがあります。また、そのインテントでメインのアクティビティを開始したいと考えています。私はこれに関連する無数の投稿を見て、さまざまなことを試しましaddCategory
た.setAction(MAIN; the activity's name; you name it, I've tried it...)
category.DEFAULT
インテントが設定される場所とマニフェストの関連部分は次のとおりです。インテントの受信者は、メイン アクティビティに登録されます。
final String NEW_DOSES = "changed to protect the innocent";
Intent bluetoothBroadcast = new Intent();
several putExtra lines here
bluetoothBroadcast.setAction(NEW_DOSES);
sendBroadcast(bluetoothBroadcast);
<activity
android:name=".AsthmaAppActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
比較的マイナーな変更でメイン アクティビティを開始するというこのインテントを取得することは可能ですか? 前もって感謝します。