Benachrichtigungen in bestimmten Zeit jeden Tag android

Ich würde gerne eine app machen, mit denen der Benutzer entscheiden, welche tägliche Zeit will ihn daran erinnern, etwas mit der Benachrichtigung...

Ich würde gerne wissen wie soll ich die trigger eine Benachrichtigung in secific Zeit der Nutzer will e.x-7:00 Uhr und stellen Sie ihn, Tippen Sie auf die Benachrichtigung, und geben Sie die Anwendung in spezifischen Aktivität. Aber wenn der Benutzer nicht wollen, um mehr Benachrichtigungen (mit einer Schaltfläche) wie bin ich Abbrechen, alle Meldungen...?

Machte ich so etwas wie

Intent intent = new Intent(this, main.class);
Bundle bundle = new Bundle();
bundle.putString("title", "Some Title");\
intent.putExtras(bundle);   
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
String body = "Tap to see the Activity"; 
String title = "Title of notification"; 
Notification n = new Notification(R.drawable.ic_launcher, body, System.currentTimeMillis());
n.setLatestEventInfo(this, title, body, pi);
n.defaults = Notification.DEFAULT_ALL;
nm.notify(uniqueID, n);

aber kein Glück bis jetzt....

Dank...

<<>>

ich bin dabei

        String ns = Context.NOTIFICATION_SERVICE;
        NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

        int icon = R.drawable.notification_icon;
        CharSequence tickerText = "Ome TickerText"; 
        long when = System.currentTimeMillis();
        Context context = getApplicationContext();
        CharSequence contentTitle = "Some Title"; 
        CharSequence contentText = "Some Text"; 

        Intent notificationIntent = new Intent(context, LandingActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("title", "a title");
        bundle.putString("title2", "title number 2");
        bundle.putString("action", "tip");
        bundle.putString("greek", "somehting else");
        bundle.putInt("action_num", 2);
        notificationIntent.putExtras(bundle);
        alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
        contentIntent = PendingIntent.getActivity(Notifications.this, 0, notificationIntent, 0);

        Notification notification = new Notification(icon, tickerText, when);
        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
        notification.defaults = Notification.DEFAULT_ALL;

        mNotificationManager.notify(UniqueID, notification);

        int hour = tp.getCurrentHour();
        int minutes = tp.getCurrentMinute();

        contentIntent = PendingIntent.getService(Notifications.this, 0, notificationIntent, 0);
        AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        calendar.set(Calendar.HOUR_OF_DAY, hour);
        calendar.set(Calendar.MINUTE, minutes);
        calendar.set(Calendar.SECOND, 00);
        alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), contentIntent);

aber keine luckk...

jede Hilfe bitte?

InformationsquelleAutor Anaisthitos | 2012-10-29
Schreibe einen Kommentar