scv_setAddressBg.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
int which = sp.getInt("which", 0);
final String[] items = {"半透明","活力橙","卫士蓝","金属灰","苹果绿"};
AlertDialog.Builder builder = new Builder(SettingActivity.this);
builder.setTitle("设置归属地显示背景");
builder.setSingleChoiceItems(items, which, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Editor edit = sp.edit();
edit.putInt("which", which);
edit.commit();
scv_setAddressBg.setDesc(items[which]);
dialog.dismiss();
}
});
builder.setNegativeButton("取消", null);
builder.show();
}
});
public void showMyToast(String address) {
<span style="color:#ff6600;">int[] ids = {R.drawable.call_locate_white,R.drawable.call_locate_orange,R.drawable.call_locate_blue
,R.drawable.call_locate_gray,R.drawable.call_locate_green};</span>
<span style="color:#ff6600;">SharedPreferences sp = getSharedPreferences("config", MODE_PRIVATE);
int which = sp.getInt("which", 1);</span>
view = View.inflate(this, R.layout.address_show, null);
TextView textView = (TextView) view.findViewById(R.id.tv_address);
textView.setText(address);
<span style="color:#ff6600;">view.setBackgroundResource(ids[which]);</span>
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
params.format = PixelFormat.TRANSLUCENT;
params.type = WindowManager.LayoutParams.TYPE_TOAST;
wm.addView(view, params);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有