Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbea0442 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Hide software input when the Activity is closed.

Input method manager does not close software input when the text
field focus is out. This is a workaround of Bug 20612313 by hiding
in onPause callback manually.

Bug: 20612313
Change-Id: I81d0c8e41b1df81c2383a361c56698a61afe89c8
parent 31599988
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.Bundle;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.RawContacts;
import android.util.Log;
import android.view.inputmethod.InputMethodManager;

import java.util.ArrayList;

@@ -224,6 +225,15 @@ abstract public class ContactEditorBaseActivity extends ContactsActivity
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
        }
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);