Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view cannot be resolved to a type

what seems to be the problem with view 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?

like image 238
Hip Hip Array Avatar asked Apr 01 '11 11:04

Hip Hip Array


People also ask

What does Cannot be resolved to a type mean?

"cannot be resolved to a type" means that the compiler has decided that, according to the syntax of the language, what it found at this place in the code has to be type, which means either a class, an interface, or a primitive tpye, but cannot find the definition of any type with that name.

Can not be resolved eclipse?

Solution: In Eclipse, the cause of this problem is that somehow the SYSTEM JRE LIBRARY associated with the project was deleted. Simple fix in Eclipse: Right Click Project you are working on from Package Explorer.


1 Answers

You should import it. If you are using Eclipse, press Ctrl+Shift+o.

like image 56
ernazm Avatar answered Sep 20 '22 12:09

ernazm