ウィジェットで複数ボタンを制御したい
ウィジェットはシンプルに作成したい。
でも機能的にどうしても複数のボタンをつける必要が出てきちゃいました。
サンプルソース
単純に、インテントを2種類作成すれば実現できます。
private static final String ACTION_BTNCLICK = “*****Service.ACTION_BTNCLICK”; private static final String ACTION_BTNCLICK2 = “*****Service.ACTION_BTNCLICK2”; Intent newintent = new Intent(); Intent newintent2 = new Intent(); |
<service android:name=”*****Service”> <intent-filter> <action android:name=”*****Service.ACTION_BTNCLICK”/> <action android:name=”*****Service.ACTION_BTNCLICK2″/> </intent-filter> </service> |
コメント