Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Plain Text by Raja ( 13 years ago )
protected static final String TAG = "MainActivity";
 Context contex;
 int icon=R.drawable.ic_launcher;
 CharSequence message="Downloading";
 
 
    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final NotificationManager mnotifymngr=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
        final Notification notification =new Notification(icon, message, System.currentTimeMillis()); 
        
        Intent intent =new Intent(MainActivity.this,Progress.class);
        final PendingIntent pintent=PendingIntent.getActivity(contex, 0,intent , 0);
        notification.setLatestEventInfo(contex, "sdfs", "asdfa", pintent);
        mnotifymngr.notify(0, notification);
        
        
    }

 

Revise this Paste

Your Name: Code Language: