Offline Notification in android
//------------------------ Offline Notification ------------- public void Notification() { sharedpreferences = getSharedPreferences( "dashbord" , Context. MODE_PRIVATE ); SharedPreferences.Editor editor = sharedpreferences .edit(); if ( sharedpreferences .getBoolean( "isnotificationset" , false )){ } else { editor.putBoolean( "isnotificationset" , true ); editor.commit(); Calendar calendar = Calendar. getInstance (); calendar.set(Calendar. HOUR_OF_DAY , 18 ); calendar.set(Calendar. MINUTE , 16 ); calendar.set(Calendar. SECOND , 0 ); Intent intent2 = new Intent(Dashboard. this , NotificationReceiver. class ); intent2.setAction(NotificationReceiver. ACTION_ALARM ); PendingIntent pendingIntent = PendingIntent. getBroadcast (Dashboard. this , 5555 , intent2, PendingIntent. FLAG_UPDATE_CURRENT ); AlarmManager am = (AlarmManager) getSystemService(Dashboard. this . ALARM_SERVICE ); am...
Comments
Post a Comment