Android 按下返回键时,listview中的Edittext会失去焦点

Android 按下返回键时,listview中的Edittext会失去焦点,android,listview,android-edittext,xamarin,focus,Android,Listview,Android Edittext,Xamarin,Focus,我有一个列表视图,里面有几个编辑文本。最初,当我第一次选择编辑文本时,我遇到了一个无法获得焦点的问题,我能够在 我有一个edittext是多行的,定义如下 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_he

我有一个列表视图,里面有几个编辑文本。最初,当我第一次选择编辑文本时,我遇到了一个无法获得焦点的问题,我能够在

我有一个edittext是多行的,定义如下

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
    <EditText
        android:inputType="textMultiLine"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="@android:color/black"
        android:id="@+id/multiLineText" />
</LinearLayout>
我不知道是什么导致了这种例外。任何帮助都将不胜感激

编辑:附加代码

主列表视图布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ListView
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/newListView"
        android:descendantFocusability="beforeDescendants" />
</LinearLayout>

谢谢你的回复,希拉克。我使用C在Mono平台上工作。我没有为EditText实现任何侦听器。只需在活动和适配器中扩展布局。如果有帮助,我还是会发布代码。你在活动中定义了edittext吗?这似乎是一个NullPointerException编辑文本是用xml定义的,并在适配器的getcell方法中膨胀。我已经发布了你要求的代码。请检查您是否可能在EditText上使用OnFocusChangeListener?不,我没有。我必须实施它吗?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ListView
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/newListView"
        android:descendantFocusability="beforeDescendants" />
</LinearLayout>
[Activity(Label = "New", MainLauncher = true, ScreenOrientation = ScreenOrientation.Portrait, WindowSoftInputMode=SoftInput.AdjustPan)]
    public class NewActivity : Activity
    {
        ListView newListView;
        NewListAdapter source;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.NewView);
            newListView = FindViewById<ListView>(Resource.Id.newListView);
            var items = GetItems(); // returns list of custom objects
            source = new NewListAdapter(this, items);
            newListView.Adapter = source;
        }
}
public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var item = this[position];
            View view = convertView;
            if (view == null)
            {

                NewItemType type = (NewItemType)GetItemViewType(position);
                switch (type)
                { 
                    //other items
                    case (NewItemType.Notes):
                     view = context.LayoutInflater.Inflate(Resource.Layout.text_input_list_item, null); //layout for the troublesome edit text
                     break;
                }
            }               

            return view;
        }