为什么我的R会报错,原来写第一个的时候都可以运行,但是后来加了多指选择后就不行了,撤销也不行
package com.example.lenovo.test001;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutCompat;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.MultiAutoCompleteTextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private AutoCompleteTextView actv;
private MultiAutoCompleteTextView mac;
private String[] res={"beijing1","beijing2","beijing3","shanghai2","hunan1"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
*1.初始化构件
* 2.适配器
* 3。初始化数据源去匹配文本框输入的内容
* 4.将adapter与当前autoCompleteTextView想绑定
* 5,设置分隔符
*/
actv=(AutoCompleteTextView)findViewById(R.id.autocompleteTextView);
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,res);
actv.setAdapter(adapter);
mac=(MultiAutoCompleteTextView)findViewById(R.id.multuautoCompleteTextView);
ArrayAdapter<String> adapter1=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,res);
mac.setAdapter(adapter1);
//设置以逗号为分隔符,
mac.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
}
}