Question

I ran into a very weird situation when I installed the BugSense package on my MVVMCross app. Every time I type a letter into the EditText the cursor moves to the first character. This is highly annoying as I have to arrow over to the end of the field to type the next character!

What I did was on the override of the "OnCreate" of my SplashScreenView I set up this:

    protected override void OnCreate(Bundle bundle)
    {
        BugSenseHandler.Instance.InitAndStartSession(new ExceptionManager(), ApplicationContext, "xxxxxxxx");
        base.OnCreate(bundle);
    }

When my splash screen goes away it moves to my LoginViewModel. My axml for my Login View looks like so:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/white_full_box">
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="false"
        android:layout_centerInParent="true"
        android:layout_marginBottom="@dimen/table_margin"
        android:layout_marginLeft="@dimen/table_margin"
        android:layout_marginTop="@dimen/dialog_margin"
        android:padding="@dimen/zero"
        android:background="@drawable/white_full_box">
        <EditText
            android:id="@+id/username"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/password"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="40dp"
            android:ems="10"
            android:hint="username"
            android:layout_marginLeft="@dimen/table_margin"
            android:inputType="textVisiblePassword"
            android:singleLine="true"
            local:MvxBind="Text UserName">
            <requestFocus />
        </EditText>
        <EditText
            android:id="@+id/password"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:ems="10"
            android:hint="password"
            android:layout_marginLeft="@dimen/table_margin"
            android:inputType="textPassword"
            local:MvxBind="Text Password" />
        <Button
            android:id="@+id/loginButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/password"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="40dp"
            android:layout_marginRight="@dimen/dialog_margin"
            android:text="Login"
            style="@style/ButtonStyle"
            local:MvxBind="Click LoginCommand" />
    </RelativeLayout>
</RelativeLayout>

And I just have normal properties that bind to the Username, Password and Login button in the view model. I did a couple things to verify this behavior:

1.) I left the bugsense initialization code and removed the Text bind from the username. In this scenario the username would behave properly but the password field would always move the character to the first character after each text entry.

2.) I reimplemented the text bind to the username field and then commented out the BugSense initialization code and everything appeared to work correctly again.

What is happening here? Where should I be doing the BugSense initialization in an MVVMCross app?

Was it helpful?

Solution

My solution was to switch to Raygun.io because that does not appear to have the same issue.

Bugsense does appear to be looking into the issue which you can follow along HERE

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top