Search in sources :

Example 56 with SimpleAdapter

use of android.widget.SimpleAdapter in project httpclient by pixmob.

the class SampleList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();
    String path = intent.getStringExtra("com.example.android.apis.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 57 with SimpleAdapter

use of android.widget.SimpleAdapter in project platform_frameworks_base by android.

the class BiDiTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mList = (ListView) findViewById(R.id.testlist);
    mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    mList.setFocusableInTouchMode(true);
    final SimpleAdapter adapter = new SimpleAdapter(this, getTests(), R.layout.custom_list_item, new String[] { "title" }, new int[] { android.R.id.text1 });
    mList.setAdapter(adapter);
    mList.setOnItemClickListener(mOnClickListener);
}
Also used : SimpleAdapter(android.widget.SimpleAdapter)

Example 58 with SimpleAdapter

use of android.widget.SimpleAdapter in project JieCaoVideoPlayer by lipangit.

the class AutoTinyNormalActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(true);
    getSupportActionBar().setDisplayUseLogoEnabled(false);
    getSupportActionBar().setTitle("AutoTinyNormal");
    setContentView(R.layout.activity_listview_content);
    listView = (ListView) findViewById(R.id.listview);
    headerLayout = (LinearLayout) getLayoutInflater().inflate(R.layout.header_auto_tiny_normal, null);
    listView.addHeaderView(headerLayout);
    JCVideoPlayerStandard jcVideoPlayerStandard = (JCVideoPlayerStandard) headerLayout.findViewById(R.id.jc_video);
    jcVideoPlayerStandard.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4", JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "嫂子坐这");
    Picasso.with(this).load("http://cos.myqcloud.com/1000264/qcloud_video_attachment/842646334/vod_cover/cover1458036374.jpg").into(jcVideoPlayerStandard.thumbImageView);
    Map<String, String> keyValuePair = new HashMap<>();
    keyValuePair.put("key", "list item");
    List<Map<String, String>> list = new ArrayList<>();
    for (int i = 0; i < 50; i++) {
        list.add(keyValuePair);
    }
    ListAdapter adapter = new SimpleAdapter(this, list, android.R.layout.simple_list_item_1, new String[] { "key" }, new int[] { android.R.id.text1 });
    listView.setAdapter(adapter);
    listView.setOnScrollListener(this);
}
Also used : HashMap(java.util.HashMap) JCVideoPlayerStandard(fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard) ArrayList(java.util.ArrayList) SimpleAdapter(android.widget.SimpleAdapter) HashMap(java.util.HashMap) Map(java.util.Map) ListAdapter(android.widget.ListAdapter)

Example 59 with SimpleAdapter

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

the class HwTests 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 60 with SimpleAdapter

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

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)72 Intent (android.content.Intent)29 ListView (android.widget.ListView)18 HashMap (java.util.HashMap)15 View (android.view.View)12 AdapterView (android.widget.AdapterView)12 Map (java.util.Map)9 ImageView (android.widget.ImageView)6 TextView (android.widget.TextView)6 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