2016-07-13 14 views
0

私はWeb開発者で、3つのAutoCompleteTextViewを使用してAndroidアプリケーションにロジックを実装しようとしています。私は1つのAutoCompleteTextViewで試して、正常に動作しました。私は3つのAutoCompleteTextViewを持って、それは動作していません。これで私を助けてください。2つ以上のAutoCompleteTextViewが機能していません

これは私のレイアウトコードです。

<AutoCompleteTextView android:id="@+id/textExecutive" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/hint_executive" /> 
<AutoCompleteTextView android:id="@+id/textSupervisor" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/hint_supervisor" /> 
<AutoCompleteTextView android:id="@+id/textManager" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/hint_manager" /> 

これは、あなたが

textExecutive.setOnTouchListener(new OnTouchListener() { 

      @Override 
      public boolean onTouch(View paramView, MotionEvent paramMotionEvent) { 
       // TODO Auto-generated method stub 
       textExecutive.showDropDown(); 
       textExecutive.requestFocus(); 
       return false; 
      } 
     }); 

は、同様に他の二つの操作を行い、と試みることができるのonCreate

textExecutive = (AutoCompleteTextView) findViewById(R.id.textExecutive); 
    textSupervisor= (AutoCompleteTextView) findViewById(R.id.textSupervisor); 
    textManager= (AutoCompleteTextView) findViewById(R.id.textManager); 

String[] executives = getResources().getStringArray(R.array.executives_array); 
    String[] supervisors = getResources().getStringArray(R.array.supervisors_array); 
    String[] managers = getResources().getStringArray(R.array.managers_array); 


ArrayAdapter<String> executivesAdapter = 
      new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, executives); 

    ArrayAdapter<String> supervisorsAdapter = 
      new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, supervisors); 

    ArrayAdapter<String> managersAdapter = 
      new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, managers); 

textExecutive.setAdapter(celebritiesAdapter); 
    textSupervisor.setAdapter(eventsAdapter); 
    textManager.setAdapter(itemsAdapter); 
+0

あなたはどのようなエラーに直面しましたか? –

+0

エラーはありません。オートコンプリート処理が動作していません –

+0

_未処理_は何を意味しますか? – Piyush

答えて

0

です。

関連する問題