AlertDialogWrapper.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:talk-android 作者:
/**
 * Set a list of items to be displayed in the dialog as the content, you will be notified of the selected item via the supplied listener.
 *
 * @param itemsId     the resource id of an array i.e. R.array.foo
 * @param checkedItem specifies which item is checked. If -1 no items are checked.
 * @param listener    notified when an item on the list is clicked. The dialog will not be dismissed when an item is clicked. It will only be dismissed if clicked on a button, if no buttons are supplied it's up to the user to dismiss the dialog.
 * @return This
 */
public Builder setSingleChoiceItems(@ArrayRes int itemsId, int checkedItem, final DialogInterface.OnClickListener listener) {
    builder.items(itemsId);
    builder.itemsCallbackSingleChoice(checkedItem, new TalkDialog.ListCallbackSingleChoice() {
        @Override
        public boolean onSelection(TalkDialog dialog, View itemView, int which, CharSequence text) {
            listener.onClick(dialog, which);
            return true;
        }
    });
    return this;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号