音楽アプリのカスタム通知を作成しようとしています。リモート ビューを使用して、通知のレイアウトをカスタマイズできることがわかりました。onClick
ただし、ボタンなどの一部のイベントの実装には使用できません...
Android のデフォルトの音楽アプリに素晴らしい通知があることがわかりました。 (Android 2.3.6)
音楽アプリのカスタム通知を作成しようとしています。リモート ビューを使用して、通知のレイアウトをカスタマイズできることがわかりました。onClick
ただし、ボタンなどの一部のイベントの実装には使用できません...
Android のデフォルトの音楽アプリに素晴らしい通知があることがわかりました。 (Android 2.3.6)
RemoteViews でクリックを使用できることを確認しますが、別のフレーバーがあります。
onUpdate
これは何かを持っているでしょう
//To goto class
Intent intent = new Intent(context, "Your class".class);
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetIds);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews.setOnClickPendingIntent(R.id.update_class, pendingIntent);
appWidgetManager.updateAppWidget(widgetId, remoteViews);
//To goto Service
Intent it = new Intent();
it.setClass(context, "Your Service".class);
PendingIntent pendingIntent1 = PendingIntent.getService(context,
0,
it, PendingIntent.FLAG_NO_CREATE);
remoteViews.setOnClickPendingIntent(R.id.service_controller,
pendingIntent);
appWidgetManager.updateAppWidget(widgetId, remoteViews);
remoteView.setOnClickPendingIntent("id of button/textview","対応する peinding インテント")を使用する必要があります。