Question: To build an exact and reliable Alarm in Android OS 6, aka Marshmallow, I am forced to use [setAlarmClock](http://developer.android.com/reference/android/app/AlarmManager.html#setAlarmClock(android.app.AlarmManager.AlarmClockInfo,%20android.app.PendingIntent)) method of AlarmManager. The problem is this method displays an alarm icon in top status bar. Since my app needs an alarm to refresh some data at midnight, everyday, it will display alarm icon forever, which is not pleasant.

Answer: 
You need to use `setExactAndAllowWhileIdle()`. If your app is not ignoring optimizations, you have 10 seconds to achieve your goal. If you need more time, a partial wakelock and/or internet access, you need to add the permission to request to the users to ignore optimizations.
If I understood you correctly you want to use the `AlarmManager` to schedule a task at midnight without displaying the UI clock. You can use [`AlarmManager#set`](https://developer.android.com/reference/android/app/AlarmManager.html#set(int,%20long,%20android.app.PendingIntent)) this will not display the clock. e.g.

```
  alarm.set(
      AlarmManager.RTC_WAKEUP,
      midnightInMillis,
      PendingIntent.getService(getApplicationContext(), 11, intent, PendingIntent.FLAG_UPDATE_CURRENT)
  );

```