Search in sources :

Example 71 with SimpleAdapter

use of android.widget.SimpleAdapter in project android_frameworks_base by crdroidandroid.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ListView lv = (ListView) findViewById(android.R.id.list);
    lv.setDrawSelectorOnTop(true);
    lv.setAdapter(new SimpleAdapter(this, SAMPLES, R.layout.item_layout, new String[] { KEY_NAME }, new int[] { android.R.id.text1 }));
    lv.setOnItemClickListener(this);
    getActionBar().setTitle("MainActivity");
}
Also used : ListView(android.widget.ListView) SimpleAdapter(android.widget.SimpleAdapter)

Aggregations

SimpleAdapter (android.widget.SimpleAdapter)71 Intent (android.content.Intent)29 ListView (android.widget.ListView)18 HashMap (java.util.HashMap)14 View (android.view.View)11 AdapterView (android.widget.AdapterView)11 Map (java.util.Map)8 TextView (android.widget.TextView)6 ImageView (android.widget.ImageView)5 FragmentManager (android.support.v4.app.FragmentManager)4 ListFragment (android.support.v4.app.ListFragment)4 OnClickListener (android.view.View.OnClickListener)4 ArrayList (java.util.ArrayList)4 Context (android.content.Context)3 ViewGroup (android.view.ViewGroup)3 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)3 ListAdapter (android.widget.ListAdapter)3 SharedPreferences (android.content.SharedPreferences)2 AssetManager (android.content.res.AssetManager)2 SQLException (android.database.SQLException)2