Search in sources :

Example 81 with SimpleAdapter

use of android.widget.SimpleAdapter in project double-espresso by JakeWharton.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setListAdapter(new SimpleAdapter(this, getData(), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
    getListView().setTextFilterEnabled(true);
}
Also used : SimpleAdapter(android.widget.SimpleAdapter)

Example 82 with SimpleAdapter

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

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    String path = intent.getStringExtra(EXTRA_PATH);
    if (path == null) {
        path = "";
    } else {
        // not root level, display where we are in the hierarchy
        setTitle(path);
    }
    FragmentManager fm = getSupportFragmentManager();
    if (fm.findFragmentById(android.R.id.content) == null) {
        ListFragment listFragment = new TestListFragment();
        listFragment.setListAdapter(new SimpleAdapter(this, getData(path), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
        fm.beginTransaction().add(android.R.id.content, listFragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ListFragment(android.support.v4.app.ListFragment) SimpleAdapter(android.widget.SimpleAdapter) Intent(android.content.Intent)

Example 83 with SimpleAdapter

use of android.widget.SimpleAdapter in project VitamioBundle by yixia.

the class VitamioListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!LibsChecker.checkVitamioLibs(this))
        return;
    setListAdapter(new SimpleAdapter(this, getData(), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
}
Also used : SimpleAdapter(android.widget.SimpleAdapter)

Example 84 with SimpleAdapter

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

the class VectorDrawableTest method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    String path = intent.getStringExtra("com.android.test.hwui.Path");
    if (path == null) {
        path = "";
    }
    setListAdapter(new SimpleAdapter(this, getData(path), android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 }));
    getListView().setTextFilterEnabled(true);
}
Also used : SimpleAdapter(android.widget.SimpleAdapter) Intent(android.content.Intent)

Example 85 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)133 HashMap (java.util.HashMap)52 ListView (android.widget.ListView)38 Intent (android.content.Intent)34 Map (java.util.Map)33 View (android.view.View)28 ArrayList (java.util.ArrayList)28 AdapterView (android.widget.AdapterView)27 TextView (android.widget.TextView)26 ViewGroup (android.view.ViewGroup)13 ListAdapter (android.widget.ListAdapter)10 ImageView (android.widget.ImageView)8 Spanned (android.text.Spanned)6 TtsSpan (android.text.style.TtsSpan)6 FrameLayout (android.widget.FrameLayout)6 Test (org.junit.Test)6 SuppressLint (android.annotation.SuppressLint)5 Context (android.content.Context)5 MotionEvent (android.view.MotionEvent)5 OnClickListener (android.view.View.OnClickListener)5