title: How create a permanent notification to show battery level
body: <p>I'm stuck in a creation of a notification..Just want display the battery level in the status bar(notifications bar)The notification has been permanent. This is part of code:</p>
  
  <pre><code>private BroadcastReceiver batteryInfoReceiver = new BroadcastReceiver() {
              @Override
              public void onReceive(Context context, Intent intent) {
  
              int  level= intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
  
                String[] status = {
                  "Level: "+level
                   . . .
                 };
  
               NotificationManager notifi = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  
               Notification notification = new Notification(R.drawable.ic_launcher,"Level",System.currentTimeMillis());
  
               notification.flags = Notification.FLAG_ONGOING_EVENT;
  
               Intent i = new Intent(context, MainActivity.class); 
  
               PendingIntent penInt = PendingIntent.getActivity(getApplicationContext(), 0 , i , 0);
  
               notification.setLatestEventInfo(getApplicationContext(), +level+"%", penInt);
  
               notifi.notify(215,notification);
  
  
              }
  };
  </code></pre>
  
  <p>Is it correct? Is there something else to add for example in the manifest? I don't have a specified class for the notification so i wrote in this way this line: <code>Intent i = new Intent(context, MainActivity.class);</code> but i don't know if it's correct.</p>