view cannot be resolved to a type
what seems to be the problem with vi开发者_开发问答ew here? how do i solve it?
the error "View cannot be resolved to a type"
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
Object o = my_listview.getItemAtPosition(position);
// write you handling code like...
String st = "sdcard/";
File f = new File(st+o.toString());
// do whatever u want to do with 'f' File object
Log.d("The position fo f:",o.toString());
}
any ideas?
You should import it. If you are using Eclipse, press Ctrl+Shift+o.
import.view.View
Sometimes If the API level specified in your manifest is below API level 12 then eclipse does'nt suggest this import. Might be because its not supported. But you can manually insert the import. The functions that require a higher API level won't work.
精彩评论