Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DateChangeBroadcastListener extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- final String action = intent.getAction();
- if (action != null && (action.equals(Intent.ACTION_DATE_CHANGED)
- || action.equals(Intent.ACTION_TIME_CHANGED))) {
- Toast.makeText(context, "Date changed", Toast.LENGTH_SHORT).show();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment