Reputation: 23
There are some actions that I wanted to be done while the app is being installed(Like onCreate but the method should be called only the time that the app is being installed on the device). The reason for that is because this action may need too much time to be done and I don't want user to wait. Thanks in advance. Ps:I don't wana use doInBackground
Upvotes: 1
Views: 115
Reputation: 1006674
Can I do something while the app is being installed?
No, sorry.
First, literally while your app is being installed, your app is not installed yet, and therefore cannot run.
If you really mean "right after the app is installed", the answer is still no. That used to be a possibility, many years ago, and it was exploited by "drive-by" malware, so it has been blocked since Android 3.1.
Upvotes: 3