Error: getExtractedText on inactive InputConnection warning on android

0 votes

I get the following warning in my logcat.

getExtractedText on inactive InputConnection

I'm unable to find the reason behind it. Please help

May 26 in Java by kartik
• 16,870 points
140 views

1 answer to this question.

0 votes

Hello @kartik,

The warning appeared when the soft keyboard was activated in one of my EditTexts and the activity lose focus.

What I did was to hide the keyboard in onPause();

@Override
protected void onPause() {

    // hide the keyboard in order to avoid getTextBeforeCursor on inactive InputConnection
    InputMethodManager inputMethodManager = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);

    inputMethodManager.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

    super.onPause();
}

Hope this work!

answered May 26 by Niroj
• 35,060 points

Related Questions In Java

0 votes
2 answers

When I am running eclispe on my computer it is throwing error. How to resolve it?

If you have downloaded the 64 bit ...READ MORE

answered Dec 10, 2018 in Java by Sushmita
• 6,890 points
192 views
0 votes
1 answer

Access restriction on class error

My guess is that you are trying ...READ MORE

answered Jun 21, 2018 in Java by Rishabh
• 3,580 points
127 views
0 votes
1 answer

How to pass an object from one activity to another on Android

One option could be letting your custom ...READ MORE

answered Jun 25, 2018 in Java by Rishabh
• 3,580 points
1,849 views
0 votes
1 answer

Calling SOAP web services on Android using JAVA

Android does not provide any sort of ...READ MORE

answered Jun 28, 2018 in Java by Sushmita
• 6,890 points
654 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,089 views
0 votes
0 answers
0 votes
1 answer

What are the key differences between python and java?

There are a lot of pressing  topics ...READ MORE

answered Aug 2, 2019 in Python by Mohammad
• 3,230 points
57 views
0 votes
1 answer

How to pass an object from one activity to another on Android?

Hello @kartik, Implement your class with Serializable. Let's ...READ MORE

answered Apr 8 in Java by Niroj
• 35,060 points
44 views
0 votes
1 answer

How to open warning/information/error dialog in swing?

Hello, You can try out : import javax.swing.JFrame; import javax.swing.JOptionPane; public ...READ MORE

answered Apr 21 in Java by Niroj
• 35,060 points
34 views