Code example for ArrayAdapter

Methods: notifyDataSetChanged

0
    private void updateDirectory() { 
        mSubdirs.clear();
        mSubdirs.addAll(getDirectories(mCurrentDir));
        mTitleView.setText(mCurrentDir);
 
        mListAdapter.notifyDataSetChanged();
    } 
 
    private ArrayAdapter<String> createListAdapter(List<String> items) {
        return new ArrayAdapter<String>(mContext, android.R.layout.select_dialog_item,
                android.R.id.text1, items) {
 
            @Override 
            public View getView(int position, View convertView, ViewGroup parent) {
                View v = super.getView(position, convertView, parent);
 
                if (v instanceof TextView) {
                    TextView tv = (TextView) v;
                    tv.getLayoutParams().height = LayoutParams.WRAP_CONTENT;
                    tv.setEllipsize(null);
Experience pair programming with AI  Get Codota for Java