2011-03-01 172 views
0
public class myView(){ 

AutoCompleteTextView textView; 

    public myView(COUNTRIES){ 

      AutoCompleteTextView textView = new AutoCompleteTextView(this); 

     ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES); 
     textView.setAdapter(adapter); 

    } 

    public AutoCompleteTextView getAutoView(){ 
     return textView; 
    } 
} 

我把AutoCompleteTextView放在一个单独的类中,我尝试使用它来创建这个类的对象。但是这不起作用,你能给我一个想法,我怎样才能在Android中为一些视图做单独的类。class for Android Views

回答