Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2848] Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40931b58

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-12-19T06:01:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, defect
ReporterVinothbabu
AssigneeRitu Agrawal
Created2012-01-24T11:44:19.000+0000
Updated2016-03-08T07:47:47.000+0000

Description

We are in a window, where upon saving the information we have to redirect the user to another window. So on the successful save, we are doing an activity.finish() and opening up the new window. Titanium.Android.currentActivity.finish(); pm.view.newWindow().open(); [OR] pm.view.newWindow().open(); Titanium.Android.currentActivity.finish(); On the new window, when i click or do any event handling stuffs... i get the following trace, with no activity happening. TRACE] W/InputManagerService( 67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41106250

Comments

  1. Devang Gandhi 2012-04-09

    Hi Vinoth, In order to address this issue, we need more details. Can you please send us some sample test case, steps to reproduce and the Titanium version you use? Once we get your reply, we will be able to consider this issue. Thanks,
  2. Suman Varma 2013-10-01

    what is resolution for this .... have you resolved or just taggged
  3. Shak Hossain 2013-11-21

    Suman, We need a test case to move this forward. If you are experiencing the same issue, please post your test case and we will have it reviewed again. Thanks,
  4. Mostafizur Rahman 2013-12-12

    Testing Environment:

    Ti CLI 3.2.0 Titanium SDK: 3.1.3 Android SDK: 4.2.2 Android Device

    Test Code

    app.js
       var win = Ti.UI.createWindow({
       	navBarHidden : false,
       	title : 'First Window',
       	backgroundColor : '#000',
       	layout : 'vertical',
       	exitOnClose : true
       
       });
       
       // Create a Button.
       var btn = Ti.UI.createButton({
       	title : 'Test Button',
       	height : Ti.UI.SIZE,
       	width : Ti.UI.SIZE,
       	top : 10,
       });
       
       var win2 = Ti.UI.createWindow({
       	navBarHidden : false,
       	title : 'Second Window',
       	backgroundColor : 'red',
       
       });
       
       // Listen for click events.
       btn.addEventListener('click', function() {
               // You would run into the reported error if you change the order here i.e. finish the current activity before opening another window
       	win2.open();
       	Titanium.Android.currentActivity.finish();
       });
       
       // Add to the parent view.
       win.add(btn);
       
       win.open();
       
       

    Steps to Test

    1. Create a new project 2. Update app.js 4. And run android device 5. Click on “Test Button” 6. Second window opens correctly
  5. Ritu Agrawal 2013-12-19

    http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Android.Activity-method-finish Excerpt from the documentation: In almost all cases, an activity is associated with a window. Activities are central to the Android Back button navigation - the Back button closes the current activity and returns to whatever activity was open previously. An activity is not created until the window is opened. When a window is created, its activity property refers to an empty JavaScript object. After the window is opened, a real Activity object is created and the properties from the JavaScript object are copied over. The activity property now refers to this real Activity object, which you can use to call the various Activity methods. Titanium.Android.currentActivity.finish() closes the current activity and goes back to the previous activity. If you have a single activity then there is no activity to go back to and you run into the error you described. You should design your application in a way so that you have an activity to fall back to. Please refer to the example code above that works fine since we are closing the second window activity in this case.

JSON Source