Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.yournameapp.app;
- import android.app.Activity;
- import android.os.Bundle;
- import android.widget.ArrayAdapter;
- import android.widget.ListView;
- public class MainActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main_activity);
- String[] listItems = {"item 1", "item 2 ", "list", "android", "item 3", "foobar", "bar", "bye", "me", "you", "us", "good" };
- ListView lv = (ListView) findViewById(R.id.your_listview_name);
- lv.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement