大神 帮帮忙
package com.example.mytime;
import android.R.string;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
public class AutoComplete extends Activity{
private AutoCompleteTextView ERtextview;
private String[] res={"sgg","ghgjh","ghjj","hghg","gjhjf","hgh"};
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.autocmplete);
ERtextview=(AutoCompleteTextView) findViewById(R.id.AC);
(ArrayAdapter<string> adapter=new ArrayAdapter<R.string>(this,
android.R.layout.simple_list_item_1, res);//这段为什么报错了,跟视频上的是一样的啊)
ERtextview.setAdapter(adapter);
}
}
(Multiple markers at this line
- The constructor ArrayAdapter<R.string>(AutoComplete, int, String[]) is undefined
- Type mismatch: cannot convert from
android.widget.ArrayAdapter<com.example.mytime.R.string> to
android.widget.ArrayAdapter<android.R.string>
这个是报错时弹出来的)