Search code examples
javaandroidoncreateactivity-finish

What happens when we call finish() in onCreate() method?


What happens when we call the finish()method for the activity inside onCreate()? Will the app get time to display the Activity, but then rapidly close, or won't it show anything? This is just a doubt that I had before reading about some malware services for android that allegedly use this idea... Does it effectively work?


Solution

  • I just tested and debugged it, the Activity starts but is immediately closes once the event is generated.