开发者

Can you run an intent or script when your app gets installed on Android?

开发者 https://www.devze.com 2023-02-13 09:58 出处:网络
RPM for instan开发者_JAVA百科ce has %post, %postun, %pre, %preun that allow you to write scripts that run during different phases of the install process. I\'d like to do things like create and populat

RPM for instan开发者_JAVA百科ce has %post, %postun, %pre, %preun that allow you to write scripts that run during different phases of the install process. I'd like to do things like create and populate a db when my Android apps get installed.

Ted


No, sorry, this is explicitly not supported.


The closest you get to that is doing things on first run, then setting a flag so that you know they've been run.


I haven't tested this, but you can register a broadcast for TIME_TICK which will gets called every minute. Do the job on the first received broadcast, then discard all future broadcasts.

Edit: CommonsWare's answer is correct, this is just a possible workaround

0

精彩评论

暂无评论...
验证码 换一张
取 消