Search code examples
androidimageviewtransition

Starting a transition on specific time in Android?


I made an transition for an imageview and I want to play it when the time in Android Phone is for example 10:00 AM, then how can I do this? I tried to do this with AlarmManager but it's of no use! It's not getting work done, is it possible to do?


Solution

  • Inside the onRecieve method put the following:

    Intent scheduledIntent = new Intent(context, YourScheduledActivity.class);
    scheduledIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(scheduledIntent);
    

    And inside the onCreate method of YourScheduledActivity, we do transition.