-1

I know this might be a basic question, but I am a beginner and I haven't been able to find an answer.

I would like to know, if it is possible to trigger some function/action while creating an activity. eg. trigger a void without user intervention, start an animation automatically after an Activity is created etc.(at the moment I am trying to trigger an animation without a button click, but this question is general and not specific code related).

I know how to bind an action to a button click and every resource I have found is doing that, I haven't, however, been able to start an animation or a void without it and I am not sure if it is possible. (I have tried using Handler, it worked but prevented the rest of the code being executed - I might have done it wrong, though as I really am a beginner)

so my question(s): Is it possible to trigger a function/animation without user intervention(click)?

If so, where can I find some resources to read about it? (I tried reading Android documentation already)

Thank you very much and I apologize if the question is too simple, I know it might be.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sophie M
  • 351
  • 5
  • 14

1 Answers1

1

Please have a look at this photo. enter image description here

It clearly explains the lifecycle of Android activity.

To answer your question, yes, it is possible to trigger a function/animation without user intervention(click). You have to call the function from onStart() activity.

Sethuraman Srinivasan
  • 1,528
  • 1
  • 20
  • 34