简体   繁体   中英

Android: call onCreate() from onResume()

My initial setup related to UI takes place in OnCreate() , but before the UI appears I need to grant permission to the app from Settings . I'm using Service to start the MainActivity (which contains fragment) from the Settings as soon the the permission is granted, but when MainActivity again appears, only onResume() from the fragment gets called, whereas I have done all setup in onCreate() . What should I do?

一个简单的解决方案是不打开片段,除非获得许可。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM