title: Notifications bar lags when onGoing notification is on
body: <p>My application has a notification in the notifications bar that shows the battery level. The notification works but when the checkbox in the preferences is clicked and the notification appears, i try to pull down the notifications bar and it lags. I don't know way but i think that it's because the notification check every second the battery level but i'm not sure.. I post the code:</p>
  
  <pre><code>@SuppressLint("NewApi")
      private void checkPref(Intent intent){ 
              this.registerReceiver(this.batteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
              SharedPreferences myPref = PreferenceManager.getDefaultSharedPreferences(MainActivity.this); 
              boolean pref_opt1 = myPref.getBoolean("firstDependent", false); 
              int level= intent.getIntExtra(BatteryManager.EXTRA_LEVEL,-1);
              if (pref_opt1){
                  NotificationManager notifi = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
                   Notification notification = new Notification.Builder(getApplicationContext())
                   .setContentTitle("Battery Informations")
                   .setContentText("Battery level"+" "+level+"%")
                   .setSmallIcon(R.drawable.icon_small_not)
                   //.setLargeIcon(aBitmap)
                   .setTicker(level+"%")
                   .build();
  
                   notification.flags = Notification.FLAG_ONGOING_EVENT;
                   Intent i = new Intent(MainActivity.this, MainActivity.class); 
                   PendingIntent penInt = PendingIntent.getActivity(getApplicationContext(), 0 , i , 0);
                   notifi.notify(215,notification);
                  } else {
                  NotificationManager notifi = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
                  notifi.cancel(215);
                  }
          }
  </code></pre>
  
  <p>Maybe the problem is this one <code>this.registerReceiver(this.batteryInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));</code>. But i know only this way to update the notification when the battery level changes.. Some helps please?</p>