1

間にスペースが認識されないため、AutoCompleteTextView のフィルター オプションを調整したいと考えています。そのため、MyAutoCompleteView というクラスを作成しました。

package my.house;

public class MyAutoCompleteView
   extends
      android.widget.AutoCompleteTextView
{

   public MyAutoCompleteView (android.content.Context context)
   {
      super (context);
   }

   public MyAutoCompleteView(android.content.Context context, android.util.AttributeSet attrs)
   {
      super(context, attrs);
   }

   public MyAutoCompleteView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
   {
      super(context, attrs, defStyle);
   }
}

このことをテストするために、レイアウト xml を次のように変更しました。

<my.house.MyAutoCompleteView
    android:id='@+id/search'
    android:layout_height='wrap_content'
    android:layout_width='fill_parent'
    android:singleLine='true'
  ></my.house.MyAutoCompleteView>

Fragmentsを使用しているので、レイアウトファイルを膨らませています。

私のフラグメントの onCreateView メソッドは次のとおりです。

@Override
   public android.view.View onCreateView (
      final android.view.LayoutInflater inflater,
      final android.view.ViewGroup container,
      final android.os.Bundle savedInstanceState)
   {

      return inflater.inflate (my.house.R.layout.myfragment, container, false);
}

残念ながら、次のエラー メッセージが表示されます。

android.view.InflateException: バイナリ XML ファイルの行 #17: クラス my.house.MyAutoCompleteView の膨張エラー

問題が何であるかについてのアイデアはありますか?ありがとう!

4

1 に答える 1

2

残念ながら、プロガードは私のコードを最適化し、コンストラクターによって削減しました。Proguard が無効になり、動作します。

于 2012-04-27T13:01:29.630 に答える