Fragment点击跳转另一个fragment快速点击回退键 回到上一个fragment点击无响应,退回后台,再切换回来时有响应,这是怎么回事?
迷茫2017-04-17 17:46:53
I don’t understand what you mean by what you wrote, but fragments should have manager activities. You can put these two fragments into the same activity management. When jumping, you only need activity operations. But!
高洛峰2017-04-17 17:46:53
The back button will only return to the previous activity. If the current activity is the main page, the application will return to the background. Fragments are operated on the activity to which they belong. The back key will not return to the previous fragment. If there is such a need, you can override onKeyDown() to set pressing the back key to return to the previous fragment. I don't know if that's what you mean.
大家讲道理2017-04-17 17:46:53
The response method of the return key is onbackpress in 'activity'. The fragment itself does not support the physical return key
大家讲道理2017-04-17 17:46:53
It may be a problem with the fragment life cycle. Try saving the view in onCreateView instead of drawing it every time.