Android: Как всегда делать клавиатуру видимой?

Что-то как следующее могло бы работать:

require 'socket'
require 'timeout'

def is_port_open?(ip, port)
  begin
    Timeout::timeout(1) do
      begin
        s = TCPSocket.new(ip, port)
        s.close
        return true
      rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
        return false
      end
    end
  rescue Timeout::Error
  end

  return false
end
33
задан Prabhu R 2 October 2009 в 14:03
поделиться

1 ответ

Add android:windowSoftInputMode="stateAlwaysVisible" to your activity in the AndroidManifest.xml file:

<activity android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateAlwaysVisible" />

In my test app this shows the keyboard on starting of the application although it isn't fixed there but can be dismissed by pressing the back button.

To make sure the keyboard is always visible you might have to create your own keyboard as part of the UI of your application. Here is a tutorial to show you how to do this with KeyboardView: http://www.fampennings.nl/maarten/android/09keyboard/index.htm

46
ответ дан 27 November 2019 в 18:16
поделиться
Другие вопросы по тегам:

Похожие вопросы: