Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor cause app crash after clicking the done/next button when on landscape mode in Android #5030

Closed
Billycool1020 opened this issue Jan 21, 2019 · 4 comments · Fixed by #5653

Comments

@Billycool1020
Copy link

commented Jan 21, 2019

Description

The app will crash after clicking the done/next button when on landscape mode.
The temp workaround is setting ImeOptions in custom renderer: Control.ImeOptions = Android.Views.InputMethods.ImeAction.Done;. Or insert one-pixel Entry control under the editor.

Steps to Reproduce

  1. Create blank Xamarin.Forms project.
  2. In MainPage.xaml put a label and an editor in stacklayout.
  3. Clicking the done/next button on landscape mode

The MainPage.xaml:

  <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:local="clr-namespace:App1"
               x:Class="App1.MainPage">
      <StackLayout >
          <Label Text="Hello" />
          <Editor ></Editor>
      </StackLayout>
  </ContentPage>

The error in output:

E/AndroidRuntime( 7833): java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
E/AndroidRuntime( 7833): 	at android.widget.TextView.onKeyUp(TextView.java:7453)
E/AndroidRuntime( 7833): 	at android.view.KeyEvent.dispatch(KeyEvent.java:2715)
E/AndroidRuntime( 7833): 	at android.view.View.dispatchKeyEvent(View.java:11713)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1834)
E/AndroidRuntime( 7833): 	at com.android.internal.policy.DecorView.superDispatchKeyEvent(DecorView.java:440)
E/AndroidRuntime( 7833): 	at com.android.internal.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1819)
E/AndroidRuntime( 7833): 	at android.app.Activity.dispatchKeyEvent(Activity.java:3267)
E/AndroidRuntime( 7833): 	at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
E/AndroidRuntime( 7833): 	at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:58)
E/AndroidRuntime( 7833): 	at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:316)
E/AndroidRuntime( 7833): 	at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:58)
E/AndroidRuntime( 7833): 	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:354)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4733)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4605)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6661)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6635)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6596)
E/AndroidRuntime( 7833): 	at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3930)
E/AndroidRuntime( 7833): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 7833): 	at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 7833): 	at android.app.ActivityThread.main(ActivityThread.java:6494)
E/AndroidRuntime( 7833): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7833): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/AndroidRuntime( 7833): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Expected Behavior

Exit the edit mode.

Actual Behavior

App crash

Basic Information

  • Version with issue: 3.4.0.1008975 & 4.0.0.62955-pre2
  • IDE: Visual Studio Enterprise 2017 15.9.5
  • Platform Target Frameworks:
    • Android: 8.1

@pauldipietro pauldipietro added this to New in Triage Jan 21, 2019

@samhouts samhouts added this to In Progress in v3.5.0 Jan 22, 2019

@samhouts samhouts removed this from New in Triage Jan 22, 2019

@samhouts samhouts closed this in b2cbef6 Jan 31, 2019

v3.5.0 automation moved this from In Progress to Done Jan 31, 2019

@samhouts samhouts moved this from Done to In Progress in v3.5.0 Jan 31, 2019

@samhouts samhouts moved this from In Progress to Done in v3.5.0 Jan 31, 2019

@MitchBomcanhao

This comment has been minimized.

Copy link

commented Feb 8, 2019

This appears to still be broken on 3.5.0.129452.
Removing the ImeAction.Done workaround makes it crash just like before.

@rafalfs

This comment has been minimized.

Copy link

commented Mar 6, 2019

Is this fixed? I'm still having this problem on 3.6.0.220655

@samhouts

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

That's disappointing! We'll reopen and investigate. Thanks!

@samhouts samhouts reopened this Mar 6, 2019

@samhouts samhouts added this to New in Triage via automation Mar 6, 2019

@DominicBurford

This comment has been minimized.

Copy link

commented Mar 7, 2019

I have reproduced this error in each of the following releases.

Xamarin.Forms -Version 3.6.0.135200-pre1
Xamarin.Forms -Version 3.6.0.169048-pre2
Xamarin.Forms -Version 4.0.0.8055-pre1
Xamarin.Forms -Version 4.0.0.62955-pre2
Xamarin.Forms -Version 4.0.0.94569-pre3
Xamarin.Forms -Version 4.0.0.135214-pre4

@kingces95 kingces95 moved this from New to Ready For Work in Triage Mar 7, 2019

@samhouts samhouts removed this from Ready For Work in Triage Mar 13, 2019

@jcmanke jcmanke referenced this issue Mar 21, 2019
2 of 3 tasks complete

@samhouts samhouts added this to In Progress in v4.1.0 Mar 22, 2019

Android Ready For Work automation moved this from To do to Done Mar 26, 2019

StephaneDelcroix added a commit that referenced this issue Mar 26, 2019
Set ImeOptions to Done on Android Editor (#5653)
* Set ImeOptions to Done on Android Editor

* Apply fix to Material Editor renderer

- fixes #4832
- fixes #5030

@samhouts samhouts moved this from In Progress to Done in v4.1.0 Mar 27, 2019

adrianknight89 added a commit to adrianknight89/Xamarin.Forms that referenced this issue Mar 29, 2019
Set ImeOptions to Done on Android Editor (xamarin#5653)
* Set ImeOptions to Done on Android Editor

* Apply fix to Material Editor renderer

- fixes xamarin#4832
- fixes xamarin#5030
codemillmatt added a commit to codemillmatt/Xamarin.Forms that referenced this issue Apr 19, 2019
Set ImeOptions to Done on Android Editor (xamarin#5653)
* Set ImeOptions to Done on Android Editor

* Apply fix to Material Editor renderer

- fixes xamarin#4832
- fixes xamarin#5030

@samhouts samhouts added this to In Progress in vCurrent (4.2.0) May 29, 2019

@samhouts samhouts removed this from Done in v4.1.0 May 29, 2019

@samhouts samhouts moved this from In Progress to Done in vCurrent (4.2.0) May 29, 2019

@samhouts samhouts removed this from Done in vCurrent (4.2.0) Jun 4, 2019

@samhouts samhouts added this to In Progress in v4.1.0 Jun 4, 2019

@samhouts samhouts moved this from In Progress to Done in v4.1.0 Jun 5, 2019

AxelUser added a commit to AxelUser/Xamarin.Forms that referenced this issue Jun 15, 2019
Set ImeOptions to Done on Android Editor (xamarin#5653)
* Set ImeOptions to Done on Android Editor

* Apply fix to Material Editor renderer

- fixes xamarin#4832
- fixes xamarin#5030
@Jamminroot Jamminroot referenced this issue Jul 18, 2019
3 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.