Search in sources :

Example 36 with Adapter

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();
}
Also used : Adapter(android.widget.Adapter) Intent(android.content.Intent)

Aggregations

Adapter (android.widget.Adapter)36 AdapterView (android.widget.AdapterView)23 View (android.view.View)18 BaseAdapter (android.widget.BaseAdapter)15 ListAdapter (android.widget.ListAdapter)12 AbsListView (android.widget.AbsListView)10 RemoteAdapterConnectionCallback (android.widget.RemoteViewsAdapter.RemoteAdapterConnectionCallback)7 TextView (android.widget.TextView)7 Intent (android.content.Intent)4 ExpandableListAdapter (android.widget.ExpandableListAdapter)4 HeaderViewListAdapter (android.widget.HeaderViewListAdapter)3 SuppressLint (android.annotation.SuppressLint)2 ExpandableListView (android.widget.ExpandableListView)2 SectionIndexer (android.widget.SectionIndexer)2 DataSetObserver (android.database.DataSetObserver)1 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)1 CursorAdapter (android.support.v4.widget.CursorAdapter)1 ViewGroup (android.view.ViewGroup)1 ArrayAdapter (android.widget.ArrayAdapter)1 ListView (android.widget.ListView)1