use of android.widget.Adapter in project weex-example by KalicyZhou.
the class AppPickerActivity method onListItemClick.
@Override
protected void onListItemClick(ListView l, View view, int position, long id) {
Adapter adapter = getListAdapter();
if (position >= 0 && position < adapter.getCount()) {
String packageName = ((AppInfo) adapter.getItem(position)).getPackageName();
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.putExtra("url", "market://details?id=" + packageName);
setResult(RESULT_OK, intent);
} else {
setResult(RESULT_CANCELED);
}
finish();
}
Aggregations