Geting “Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy” in Android

后端 未结 5 1903
余生分开走
余生分开走 2020-12-19 08:42

When I am going from one intent to another intent, I am getting this warning :

\"Window already focused, ignoring focus gain of: com.android.internal.view.IInputMeth

相关标签:
5条回答
  • 2020-12-19 09:08

    I had a different problem. I was able to change activities once, but not more than that. I think it was a combination of using Intent.FLAG_ACTIVITY_NO_HISTORY when navigating to the second Activity, and using Activity.startActivity to return to the first application. When I switched to using Activity.finish() to leave the second Activity and return to the first, everything started working better.

    0 讨论(0)
  • 2020-12-19 09:14

    Some special hidden char or somesuch in the mainifest.xml. Pasted from another manifest.xml:

    android:screenOrientation="landscape"
    

    After the problem, deleted and typed in manually. Then clean, build. And works. Fun.

    0 讨论(0)
  • 2020-12-19 09:18

    I had this error when "mainPage" (started intent) was not declared on Manifest file,
    try to add :
    <activity android:name=".mainPage" />

    0 讨论(0)
  • Another solution: check the onCreate, onResume, etc. methods of your Activity that is being opened. In my case, I had changed some code so that my onCreate method would call this.finish(); before the end of the method. I'm guessing some sort of race condition occurs when you do that and every time I opened my Activity I would get the same thing in logcat:

    W/InputManagerService(  104): Window already focused, 
    ignoring focus gain of: 
    com.android.internal.view.IInputMethodClient$Stub$Proxy@46399630
    

    Fix the activity that's being opened! If you need to close the activity immediately after opening, find some other way to do it; maybe via the runOnUiThread method, I don't know.

    0 讨论(0)
  • 2020-12-19 09:19

    Got the same problem yesterday, due to a typo in the activity declaration on androidManifest.xml,but even after fixed the error persisted.

    After restarting the Eclipse and the emulator I got this message in the console:once the main activity was launched:

    "emulator: emulator window was out of view and was recentred"

    and the secondary activity launched w/o problems.

    0 讨论(0)
提交回复
热议问题