弹窗item选择

----------
final String[] buyOrhangStr = new String[] { "市价买入", "委托买入" }; // 钞汇标识
Dialog alertDialog = new AlertDialog.Builder(this).setItems(
buyOrhangStr, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
tvbuyOrhang.setText(buyOrhangStr[which]);
if (which == 0) {
buyOrhang = 0;
llNormalBuyContent.setVisibility(View.VISIBLE);
llTrustContent.setVisibility(View.GONE);
} else {
llNormalBuyContent.setVisibility(View.GONE);
llTrustContent.setVisibility(View.VISIBLE);
buyOrhang = 1;
}
}
}).create();
alertDialog.setCanceledOnTouchOutside(true);
alertDialog.show();
发布了6 篇原创文章 · 获赞 6 · 访问量 1万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览