Disable fullscreen softkeyboard in landscape mode (can't see app when writing)

1.7k views Asked by At

I'm developing an tablet application using the FLEX 4.6 SDK. The application runs only in landscape mode and not in portrait mode.

I have a TextInput on one of my views that when it's tapped, the IME (input method editor) takes the user to another screen (fullscreen mode) that is placed on top of my View. The problem is that I don't want the user to lose the sight of the application when he is typing letters, because I need him to see the live filtering of a list.

I read a lot and found out that I have to add the android:imeOptions="flagNoExtractUi" sentence in android XML manifest. I have no idea where to put it.

I found the following example using the flagNoExtractUi sentence:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"         
    >

    <EditText
        android:imeOptions="flagNoExtractUi"
        android:id="@+id/etTextInAct"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" >   
        <requestFocus />
    </EditText>

</LinearLayout>

I tried putting it inside my <activity>, as a sibling of its <intent-filter> but nothing happened.

Next is my xml manifest:

<android>
        <manifestAdditions><![CDATA[
            <manifest android:installLocation="auto">
                    <!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
                    <!--Removing the permission android.permission.INTERNET will have the side effect of preventing you from debugging your application on your device-->
                <uses-permission android:name="android.permission.INTERNET"/>
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                    <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
                    <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
                    <!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together in order to access AIR's SystemIdleMode APIs-->
                    <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
                    <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
                    <!--<uses-permission android:name="android.permission.CAMERA"/>-->
                    <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
                    <!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled together in order to use AIR's NetworkInfo APIs-->
                    <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
                    <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
                <application android:enabled="true">
                    <activity android:excludeFromRecents="false">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN" />
                            <category android:name="android.intent.category.DEFAULT" />
                            <category android:name="android.intent.category.LAUNCHER" />
                            <category android:name="android.intent.category.HOME" />
                        </intent-filter>
                        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"         
                            >

                            <EditText
                                android:imeOptions="flagNoExtractUi"
                                android:id="@+id/etTextInAct"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:ems="10" >   
                                <requestFocus />
                            </EditText>

                        </LinearLayout>
                    </activity>
                </application>  
            </manifest>

        ]]></manifestAdditions>
</android>

When I tried that, the Flex 4.6 SDK sent the following error: error 402: Current Android sdk version doesn't support LinearLayout as xml tag. I previously tried it using Flex 4.5.1 SDK but it also didn't work.

I also tried it using just the previous <EditText> tag but it also gave me the 402 error.

I want to add that the versions of the ADB and AAPT of the Flex 4.6 SDK are Android Debug Bridge version 1.0.26 and Android Asset Packaging Tool, v0.2.

On the following documentation link is stated that the android:imeOptions="flagNoExtractUi was included on Andoird since the 1.5 version, so the Flex 4.6 SDK should also be capable of including that tag.

I have no more information to give so the only thing left is to ask for your help. Does someone know how to use the android:imeOptions="flagNoExtractUi" and where should I put it?

1

There are 1 answers

0
Brinca On

I'm struggling with the same issue but it seems that there is simply no fix... :(

You can't include a layout file in AIR's xml descriptor (nor will it be magically picked up by the compiler), and there doesn't seem to have any global NoExtractUI flag either, so there you go.. not much left to try.

One you thing you can do however is upvote for the implementation of this feature at Adobe's bugbase: https://bugbase.adobe.com/index.cfm?event=bug&id=3789398

@Chris Stratton: The OP is talking about the Flex SDK which uses Adobe's AIR (mxmlc) compiler, a cross platform tool which supports (among others) an Android export target. This is obviously incompatible with the regular Android compiler, and of course doesn't support Java, XML, or any other Android specific resources/hooks (save a subset of the app's manifest which may be encapsulated in AIR's own xml descriptor file)