相关疑难解决方法(0)

Android:如何使键盘始终可见?

在android中,我们如何让设备键盘在应用程序中始终可见?顶部显示应用程序要呈现的内容,底部显示键盘.

android keypad

33
推荐指数
2
解决办法
4万
查看次数

如何在Android活动中显示虚拟键盘

为什么我无法在我的活动中显示虚拟键盘.这是我的代码:

package som.android.keypad;

import android.app.Activity;
import android.os.Bundle;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

public class ShowKeypad extends Activity {
    InputMethodManager imm;

    @Override
    public void onCreate(Bundle icicle) {

    super.onCreate(icicle); 
    EditText editText = (EditText)findViewById(R.id.EditText);

    ((InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE)).showSoftInput(editText, 0); 



    }

}

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="som.android.keypad"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ShowKeypad"
                  android:windowSoftInputMode="stateAlwaysVisible"  
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
    <uses-sdk android:minSdkVersion="4" />

</manifest> 
Run Code Online (Sandbox Code Playgroud)

android

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×2

keypad ×1