Android ListFragment conflicts with a type defined in the same file – Heights of Ignorance

Yesterday I stumbled upon below error while developing my Android application which also has a ListFragment

[sourcecode language="java"]The import android.support.v4.app.ListFragment conflicts with a type defined in the same file[/sourcecode]

I had android-support-v4.jar in my libs folder and I was finding it
very difficult to understand what could go wrong in such a simple class.

And after taking a closer look it was heights of ignorance :),
see my class definition below:
[sourcecode language=”java”]
import android.support.v4.app.ListFragment;

public class ListFragment extends ListFragment {

}
[/sourcecode]
I had given my class name as ListFragment,
and compiler was correctly telling me what went wrong.


Posted

in

, ,

by

Tags:

Comments

Leave a Reply

Discover more from Code Holic

Subscribe now to keep reading and get access to the full archive.

Continue reading