Comments (5)
Wow, seems I need to look into unpredictable human behaviors :P
Thanks for letting me know. It's due to the fact that I didn't explicitly save the state of every UI component, so when you rotate the screen they will be lost (because UI will be redrawn/reloaded).
I'll fix that in the near future, hopefully this week.
from easer.
Hahaha, rotating the screen is a good test to see whether an app is robust before configuration changes, a phone call while the activity is showing is pretty unlikely but possible, as other changes :)
Activities manage added fragments and their state, to a certain extent.
I have cloned your project, the problem is that EVERY TIME the main activity is created (onCreate(Bundle)), all fragments are removed and the "FRAGMENT_OUTLINE" is added to the activity. This can be solved by simply checking whether the app was abnormally terminated by the system: (if(savedInstanceState == null)...)
from easer.
Hmm, I didn't read those materials talking about how states are preserved / need to be preserved (though I know they can and need to be preserved). That's another reason why I didn't add that part in the code in the first place.
Thanks for your pointing out.
Are there any general rules / behaviors about what states will be preserved by runtime / Android and what states need to be explicitly saved by developers? Then I can give a quick check over other components.
from easer.
I recommend reading the Android documentation; as a starting point activity life-cycle
Essentially it says that the Android system will save and restore most of the state of the view hierarchy.
Fragments added to an activity are stored as part of the activity state by the android system. Also, their life-cycle is closely tied to the host activity's life-cycle and their handling is very similar to that of the activities
from easer.
Closed as of patch #11 (which is squashed to commit 9e9f051).
Thanks for you work and recommendation :)
from easer.
Related Issues (20)
- wifi or data does not work
- [FR] Monitor directory HOT 4
- Improving the usage example HOT 1
- [FR] "wait" profile command
- Wiki pages vandalized HOT 1
- [FR] Multiple conditions?
- Crash when opening `Pivot`
- Download link is dead.
- FeatureRequest: Add option to scan for available networks and connect to a better one if in range
- [FR] Wi-Fi disconnection trigger
- [FR] dynamics string sanitization
- [FR] Condition valid for <x> time (duration condition)
- Can I initiate power off/on, enabled/disable battery saving mode? HOT 1
- Broadcast not accepted by Android system HOT 2
- Profile triggering at the wrong time
- Media volume issue
- [FR] Detect USB connections/input devices.
- [support] Where is the user support forum? (sending contents of notification) HOT 3
- [FR] use WGTunnel for Wireguard intent
- Latest APK HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easer.