Search in sources :

Example 1 with StringArrayAdapter

use of org.litepal.litepalsample.adapter.StringArrayAdapter in project LitePal by LitePalFramework.

the class ModelListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.model_list_layout);
    mModelListview = (ListView) findViewById(R.id.model_listview);
    populateMappingClasses();
    mAdapter = new StringArrayAdapter(this, 0, mList);
    mModelListview.setAdapter(mAdapter);
    mModelListview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View view, int index, long id) {
            ModelStructureActivity.actionStart(ModelListActivity.this, mList.get(index));
        }
    });
}
Also used : StringArrayAdapter(org.litepal.litepalsample.adapter.StringArrayAdapter) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 2 with StringArrayAdapter

use of org.litepal.litepalsample.adapter.StringArrayAdapter in project LitePal by LitePalFramework.

the class TableListActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.table_list_layout);
    mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
    mTableListview = (ListView) findViewById(R.id.table_listview);
    mAdapter = new StringArrayAdapter(this, 0, mList);
    mTableListview.setAdapter(mAdapter);
    populateTables();
    mTableListview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View view, int index, long id) {
            TableStructureActivity.actionStart(TableListActivity.this, mList.get(index));
        }
    });
}
Also used : StringArrayAdapter(org.litepal.litepalsample.adapter.StringArrayAdapter) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Aggregations

View (android.view.View)2 AdapterView (android.widget.AdapterView)2 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)2 ListView (android.widget.ListView)2 StringArrayAdapter (org.litepal.litepalsample.adapter.StringArrayAdapter)2