bahareh a
bahareh a

Reputation: 11

list view in Android (eclipse)

I made list view with below code and I made array list in values. but I can't see my list when I run my program. What can I do?

public class ListView extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);;

        ArrayAdapter<string>adapter;
        adapter=new ArrayAdapter<string>(this,android.R.layout.simple_list_item_1,com.example.listview.R.array.countries);

        setListAdapter(adapter);
    }

Upvotes: 1

Views: 54

Answers (1)

mari
mari

Reputation: 874

This line is missing: setContentView(R.layout.simple_list_item_1); , no? Try this.

Upvotes: 1

Related Questions