android - Fragment中出现的问题?
PHPz
PHPz 2017-04-17 17:44:53
0
5
700

Fragment点击跳转另一个fragment快速点击回退键 回到上一个fragment点击无响应,退回后台,再切换回来时有响应,这是怎么回事?

PHPz
PHPz

学习是最好的投资!

reply all(5)
迷茫

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!

小葫芦

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.

大家讲道理

The response method of the return key is onbackpress in 'activity'. The fragment itself does not support the physical return key

大家讲道理

It may be a problem with the fragment life cycle. Try saving the view in onCreateView instead of drawing it every time.

Peter_Zhu

Maybe the Fragments are overlapping

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template