[英]android - I change the perspective when I turn my phone, my mediaPlayer and application stoping
I created an application for playing media file, it's work fine. 我创建了一个播放媒体文件的应用程序,一切正常。 but I change the perspective when I turn my phone, my application stoping. 但是当我转动手机时,我改变了视角,我的应用程序停止了。
When you change orientation, Android will re-create the Activity. 当您更改方向时,Android将重新创建活动。 So, you'll need to specifically handle the orientation change by overriding the onConfigurationChanged method of your Activity. 因此,您将需要通过覆盖Activity的onConfigurationChanged方法来专门处理方向更改。
@Override
public void onConfigurationChanged(Configuration newConfig) {
// your code here.
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.