use of android.widget.SimpleAdapter in project android_frameworks_base by crdroidandroid.
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);
}
use of android.widget.SimpleAdapter in project android_packages_apps_Settings by LineageOS.
the class ZonePicker method constructTimezoneAdapter.
/**
* Constructs an adapter with TimeZone list. Sorted by TimeZone in default.
*
* @param sortedByName use Name for sorting the list.
*/
public static SimpleAdapter constructTimezoneAdapter(Context context, boolean sortedByName, int layoutId) {
final String[] from = new String[] { ZoneGetter.KEY_DISPLAY_LABEL, ZoneGetter.KEY_OFFSET_LABEL };
final int[] to = new int[] { android.R.id.text1, android.R.id.text2 };
final String sortKey = (sortedByName ? ZoneGetter.KEY_DISPLAY_LABEL : ZoneGetter.KEY_OFFSET);
final MyComparator comparator = new MyComparator(sortKey);
final List<Map<String, Object>> sortedList = ZoneGetter.getZonesList(context);
Collections.sort(sortedList, comparator);
final SimpleAdapter adapter = new SimpleAdapter(context, sortedList, layoutId, from, to);
adapter.setViewBinder(new TimeZoneViewBinder());
return adapter;
}
use of android.widget.SimpleAdapter in project platform_frameworks_base by android.
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);
}
use of android.widget.SimpleAdapter in project platform_frameworks_base by android.
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");
}
use of android.widget.SimpleAdapter in project platform_frameworks_base by android.
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();
}
}
Aggregations