Я хотел бы контролировать запуск приложения из панели уведомлений. Поэтому я хотел бы перехватить любое действие на любом значке на этой панели. код, приведенный ниже, дает пример того, как значок уведомления запускает приложение с ним.
private void handleCommand(Intent intent){
// In this sample, we'll use the same text for the ticker and the expanded notification
CharSequence text = getText(R.string.service_running);
// Set the icon, scrolling text and timestamp
Notification notification = new Notification(R.drawable.statusbar_icon, text,
System.currentTimeMillis());
// The PendingIntent to launch our activity if the user selects this notification
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, AppLockerActivity.class), 0);
// Set the info for the views that show in the notification panel.
notification.setLatestEventInfo(this, text,
text, contentIntent);
startForegroundCompat(R.string.service_running, notification);
startMonitorThread((ActivityManager)this.getSystemService(Context.ACTIVITY_SERVICE));
}
Я хотел бы обнаружить все намерения и реализовать службу аутентификации, для которой требуется пароль перед запуском приложений из панели уведомлений.