"The method setListAdapter(ArrayAdapter) is undefined for the type create"

android, database, java

Solution

When you call `this.setListAdapter` this must extend `ListActivity` probably you class just extends `Activity`.

Problem

I am completely new to java & android, so I tried to find useful samples from android & databases. I found this blog with a project: http://saigeethamn.blogspot.com/2009/10/android-developer-tutorial-part-12.html I ran the project and it works fine, but I was trying to create a new project to copy & paste the code in it and this is not working :( I had a problem on this line: ``` this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,results)); ``` This is the error I get: The method setListAdapter(ArrayAdapter) is undefined for the type create It looks like a method in C#, but I can find it in the original project. Where did I make a mistake?

Original source