title: Problem with  the popup/notification in Android?
body: <p>I have created an activity in which I have created a progress bar as follows, and I have written the Notification but it's not working.  Notification occurs at top corner of the screen sometimes.  I want that Notification as a message box in the middle of the screen.  How to achieve it?  My activity code as follows:</p>
  
  <pre><code>public class oddg extends Activity implements OnClickListener
  {
      ProgressDialog dialog;
      int increment;
      int maximum ;
      private NotificationManager mManager;
  
       private static final int APP_ID = 0;
  
      @Override
      public void onCreate(Bundle savedInstanceState) 
      {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main1);
          Button startbtn = (Button) findViewById(R.id.startbtn);
          startbtn.setOnClickListener(this);
          mManager = (NotificationManager)   
             getSystemService(Context.NOTIFICATION_SERVICE);
    }
  
      @Override
      public void onClick(View arg0) 
      {
  
          // get the increment value from the text box
          EditText et = (EditText) findViewById(R.id.increment);
          // convert the text value to a integer
          increment = Integer.parseInt(et.getText().toString());
  
          dialog = new ProgressDialog(this);
          dialog.setCancelable(true);
          dialog.setMessage("Loading...");
          // set the progress to be horizontal
          dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
          // reset the bar to the default value of 0
          dialog.setProgress(0);
  
          // get the maximum value
          EditText max = (EditText) findViewById(R.id.maximum);
          // convert the text value to a integer
            maximum = Integer.parseInt(max.getText().toString());
          // set the maximum value
          dialog.setMax(maximum);
          // display the progressbar
          dialog.show();
  
          // create a thread for updating the progress bar
          Thread background = new Thread (new Runnable() {
             public void run() 
             {
                 try 
                 {
  
             // enter the code to be run while displaying the progressbar.
                 // This example is just going to increment the progress bar:
                // So keep running until the progress value reaches maximum value
              while(dialog.getProgress()&lt;= dialog.getMax()) 
                {
                         // wait 500ms between each update
                         Thread.sleep(500);
                         // active the update handler
                       progressHandler.sendMessage(progressHandler.obtainMessage());
                     }
                 }
                 catch (java.lang.InterruptedException e) 
                 {
                     // if something fails do something smart
                 }
             }
          });
          // start the background thread
          background.start();
       }
  
   // handler for the background updating
      Handler progressHandler = new Handler()
      {
          public void handleMessage(Message msg) 
          {
              if(dialog.getProgress()== dialog.getMax())
              {
                  Notification notification = new Notification(R.drawable.icon,"Click here", System.currentTimeMillis());
  
                  notification.setLatestEventInfo(oddg.this,"App Name","Description of the notification",PendingIntent.getActivity(getApplicationContext(), CONTEXT_IGNORE_SECURITY, getIntent(), CONTEXT_IGNORE_SECURITY));
  
              }
              dialog.incrementProgressBy(increment);
          }
  
      };
  </code></pre>