Programming for android: Compilation error using PendingIntent on newest questions tagged android – Stack Overflow

So I’m working on a chunk of code that will allow me to run an app out of the Status bar at the top I’m a good way into it and almost finished. I just need a second opinion on why my “PendingIntent.getActivity(this,that,next,thing);” Its not compiling.
Here’s the code

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;

public class NotifyMe extends Activity {
NotificationManager nm;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    Intent MainActivity = new Intent(this, MainActivity.class);
    PendingIntent pi = new PendingIntent.getActivity(this, 0, intent, 0);
    String body = "Simple message";
    String title = "Hello World";
    Notification n = new Notification(R.drawable.note, body, System.currentTimeMillis());
    n.setLatestEventInfo(this, title, body, pi);

}
}

So I might be doing this all wrong, any tips in this matter will be greatly appreciated.

See Answers


source: http://stackoverflow.com/questions/11530830/compilation-error-using-pendingintent
Programming for android: programming-for-android



online applications demo