Code example for ArrayAdapter

Methods: getItem

            public void onClick(DialogInterface dialog, int which) {
                // We currently do not pass the dataSet argument to the listener. To do so, we would 
                // have to determine the dataSet as it is done in AccountTypeManager. 
                ((Listener) getActivity()).onAccountChosen(accountAdapter.getItem(which),
                        null, parameters.getInt(EXTRA_TAG));
        builder.setTitle("Choose account to send to editor");
        builder.setSingleChoiceItems(accountAdapter, 0, clickListener);
        final AlertDialog result = builder.create();
        return result;
    public static Bundle createBundle(int tag) {
        final Bundle result = new Bundle();
        result.putInt(EXTRA_TAG, tag);
        return result;