Android Open Source - Gamers.ba-Mobile-app Reminder Service Poruke






From Project

Back to project page Gamers.ba-Mobile-app.

License

The source code is released under:

GNU General Public License

If you think the Android project Gamers.ba-Mobile-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ba.gamers.gamersba.NotificationReminder;
/*  w w w  . java2 s .  c o m*/
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

import ba.gamers.gamersba.R;
import ba.gamers.gamersba.RealActivity.WebActivity;

/**
 * Created by Amar on 19.11.2014.
 */

public class ReminderServicePoruke extends IntentService {
    private static final int NOTIF_ID = 1;

    public ReminderServicePoruke(){
        super("ReminderServicePoruke");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        long when = System.currentTimeMillis();         // notification time
        Notification notification = new Notification(R.drawable.gba_icon, "reminder", when);
        notification.defaults |= Notification.DEFAULT_SOUND;
        notification.flags |= notification.FLAG_AUTO_CANCEL;
        Intent notificationIntent = new Intent(this, WebActivity.class);
        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent , 0);
        notification.setLatestEventInfo(getApplicationContext(), "Imas novu poruku!", "Klikni da je vidis!", contentIntent);
        nm.notify(NOTIF_ID, notification);
    }

}




Java Source Code List

ba.gamers.gamersba.ApplicationTest.java
ba.gamers.gamersba.MyActivity.java
ba.gamers.gamersba.BackgroundProcess.doInBackground.java
ba.gamers.gamersba.LoginScreen.Login.java
ba.gamers.gamersba.NotificationReminder.ReminderServicePoruke.java
ba.gamers.gamersba.RealActivity.WebActivity.java
ba.gamers.www.gamers.ApplicationTest.java
ba.gamers.www.gamers.MyActivity.java