我对这个覆盖注释有一个烦人的问题,我来谷歌寻找解决方案,但我找不到任何线索。我已将 JDK 合规性设置为 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();
}
});
}