Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 带有外部键盘的手机。防止改变方向_Android_Keyboard_Orientation - Fatal编程技术网

Android 带有外部键盘的手机。防止改变方向

Android 带有外部键盘的手机。防止改变方向,android,keyboard,orientation,Android,Keyboard,Orientation,我有一个大问题,那些手机不仅有软键盘,所有手机都有(在屏幕上)。。。我说的是那些外置键盘硬件的手机 在这一刻,我设置了所有的活动,强制一种方式,纵向。现在问题来了,当用户翻转外部键盘时,活动会改变方向,迫使应用程序关闭 如果有人不知道我说的是哪部手机,这里举个例子: 我的舱单的一部分 <activity android:name=".Splash" android:label="@string/app_name" android:noHistory="

我有一个大问题,那些手机不仅有软键盘,所有手机都有(在屏幕上)。。。我说的是那些外置键盘硬件的手机

在这一刻,我设置了所有的活动,强制一种方式,纵向。现在问题来了,当用户翻转外部键盘时,活动会改变方向,迫使应用程序关闭

如果有人不知道我说的是哪部手机,这里举个例子:

我的舱单的一部分

<activity
      android:name=".Splash"
      android:label="@string/app_name"
      android:noHistory="true"
      android:screenOrientation="portrait"
      android:theme="@android:style/Theme.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>

<activity
     android:windowSoftInputMode="stateHidden"
     android:name=".MainActivity"
     android:screenOrientation="portrait"
     android:theme="@android:style/Theme.NoTitleBar" >
</activity>


如何使键盘忽略方向?

尝试将其添加到活动清单中

android:configChanges= "keyboardHidden|orientation"

在每项活动中,或者仅在第一项活动中?在任何您不希望android在拔出键盘时进行默认重置的活动中。