0

Android Webビューで、向きを変更するとキーパッドが消えますが、向きを変えるとキーパッドが消えないようにする方法はありますか?参考のために私のコードを見つけてください、

Android-Manifest.xml

  <activity
        android:name="com.alere.mya.WebContainerActivity"
        android:configChanges="orientation|keyboardHidden|keyboard"
        android:label="@string/app_name"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:theme="@android:style/Theme.NoTitleBar"
        android:windowSoftInputMode="stateUnchanged" android:launchMode="singleInstance">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

アクティビティ、

public void onConfigurationChanged(Configuration newConfig){

    ImageView imageView = (ImageView) findViewById(R.id.imageView1);
    // Checks the orientation of the screen
    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
        imageView.setImageDrawable(this.getResources().getDrawable(
                R.drawable.default_landscape));
        Log.d("on Landscape Orientation", webview.toString());
        webview.loadUrl(MyaConstant.orientationLandscape);

    } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
        Log.d("on Portrait Orientation", webview.toString());
        imageView.setImageDrawable(this.getResources().getDrawable(
                R.drawable.m_logo));
        webview.loadUrl(MyaConstant.orientationPortrait);
    }
    if (onGraph) {
        getCurrentOrientation();

    }
    super.onConfigurationChanged(newConfig);

}

ここで何が問題なのですか。誰でも私を提案できますか?

最初から最後の行としてsuper.onConfigurationChangedを試してみました。まだ応答がありません。

4

0 に答える 0