0

I have an activity which has fragment and android.intent.category.MULTIWINDOW_LAUNCHER | android.intent.category.LAUNCHER intent-filter.

If I open the app firstly, it follows the following sequence : onCreate - onResume and activity works nicely ✓</p>

If I open the application via pendingIntent on notification, it follows the following sequence : onNewIntent - onResume and activity works nicely ✓</p>

If I shrink activity to split screen, it follows the following sequence : onResume - onPause although the activity screen appears, activities view operations are not working. I want to work in this state too ✗</p>

Please help me.

<activity
            android:name=".android.baby.TabActivity"
            android:configChanges="layoutDirection|locale|keyboard|keyboardHidden|orientation|screenSize"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="stateHidden|adjustPan|adjustResize">
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
            </intent-filter>
        </activity>
4

1 回答 1

0

我阅读了本教程并解决了:https ://developer.android.com/guide/topics/ui/multi-window.html#lifecycle

例如,处于此状态的视频播放应用程序应继续显示其视频。因此,我们建议播放视频的活动不要暂停视频播放以响应 ON_PAUSE 生命周期事件。相反,活动应该开始播放以响应 ON_START,并暂停播放以响应 ON_STOP。如果您直接处理生命周期事件而不是使用 Lifecycle 包,请在 onStop() 处理程序中暂停视频播放,并在 onStart() 中恢复播放。

我关心的onStart and onStop方法不是onResume- onPause

于 2017-12-11T12:50:34.220 回答