我对这个覆盖注释有烦人的问题,我来谷歌寻找解决方案,但我找不到任何线索。我已经将JDK Compliance设置为1.6它有一个默认值,但是eclipse仍然要求我删除覆盖,我应该怎么做才能克服这个问题?
import android.os.Bundle;
import android.app.Activity;
import android.view.*;
import android.widget.*;
public class HelloList extends Activity {
ListView list;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_list);
list = (ListView)findViewById(R.id.list);
String[] values = new String[]{"StudentSite", "Staffsite", "BAAK", "Seminar"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, values);
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int pos, long id)
{
Toast.makeText(getApplicationContext(), pos, Toast.LENGTH_LONG).show();
}
});
}
答案 0 :(得分:0)
尝试将SDK设置为1.7版本,然后它不会要求您删除覆盖
步骤是: