@Override protected void onPostExecute(String result) { super.onPostExecute(result); try { String zhye = JsonUtils.getKyjeFromJson(result); JSONObject jsonObject = new JSONObject(result); String userbank = jsonObject.getString("yinhangkanum"); SharePreferenceUtil.getInstance(getActivity().getApplicationContext()) .setUserBank(userbank); String money = getPrecisionMoney(zhye); SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).setUserZhye(money); tv_zhye.setText("¥ " + money + " 元"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
private void initViews(View v) { // TODO Auto-generated method stub user_head_img = (ImageView) v.findViewById(R.id.user_head_img); user_head_img.setImageResource(R.drawable.icon_user_img); String id = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUseId(); List<ImageBean> bean = dao.select(id); if (bean != null && bean.size() > 0) { ImageLoader.getInstance() .displayImage(bean.get(0).getUrl(), user_head_img, ImageLoadOptions.getOptions()); } else { user_head_img.setImageResource(R.drawable.icon_user_img); } tv_account = (TextView) v.findViewById(R.id.tv_account); String account = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUserName(); tv_account.setText(account); tv_tel = (TextView) v.findViewById(R.id.tv_tel); String tel = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUserTel(); tv_tel.setText(StringUtils.getTelNum(tel)); txt_zcgl = (TextView) v.findViewById(R.id.txt_zcgl); txt_tzgl = (TextView) v.findViewById(R.id.txt_tzgl); txt_jlcx = (TextView) v.findViewById(R.id.txt_jlcx); txt_wdyhk = (TextView) v.findViewById(R.id.txt_wdyhk); txt_wdxx = (TextView) v.findViewById(R.id.txt_wdxx); txt_myredpager = (TextView) v.findViewById(R.id.txt_myredpager); layout_zhaq = (RelativeLayout) v.findViewById(R.id.layout_zhaq); layout_ssmm = (RelativeLayout) v.findViewById(R.id.layout_ssmm); tv_safelevel = (TextView) v.findViewById(R.id.tv_safelevel); String safelevel = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getSafelevel(); tv_safelevel.setText(safelevel); tv_zhye = (TextView) v.findViewById(R.id.tv_zhye); linearlayout = (LinearLayout) v.findViewById(R.id.linearlayout); tv_ssmm = (TextView) v.findViewById(R.id.tv_ssmm); boolean isHasGesturePsd = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).isHasGesturePsd(); if (isHasGesturePsd) { tv_ssmm.setText(R.string.ssmm_msg); } else { tv_ssmm.setText(R.string.no_setting); } }
@SuppressLint("InflateParams") private void showDialog() { // TODO Auto-generated method stub LayoutInflater layoutInflater = LayoutInflater.from(getActivity()); viewAddEmployee = layoutInflater.inflate(R.layout.activity_dialog, null); editText = (EditText) viewAddEmployee.findViewById(R.id.editText1); tv_phone = (TextView) viewAddEmployee.findViewById(R.id.tv_phone); bt_setting = (Button) viewAddEmployee.findViewById(R.id.bt_setting); bt_cancel = (Button) viewAddEmployee.findViewById(R.id.bt_cancel); String tel = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUserTel(); tv_phone.setText(StringUtils.getTelNum(tel)); showPop(); bt_setting.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String psd = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUserPsd(); String password = editText.getText().toString().trim(); if (TextUtils.isEmpty(password)) { ShowToast("密码不能为空!"); return; } if (password.equals(psd)) { avatorPop.dismiss(); intentAction(getActivity(), GesturePsdActivity.class); } else { ShowToast("输入密码错误!"); } } }); bt_cancel.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub avatorPop.dismiss(); } }); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.activity_account, container, false); dao = new ImageDaoImpl(getActivity()); userid = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()).getUseId(); initTopBarTitle("我的账户", v); initViews(v); initEvents(); if (!NetworkUtils.isNetworkAvailable(getActivity().getApplicationContext())) { ShowToast(R.string.tv_network_available); String zhye = "0.0"; tv_zhye.setText("¥ " + zhye + " 元"); } else { mt = new MyAnsyTask(); mt.execute(userid); } return v; }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.user_head_img: intentAction(getActivity(), SetInofActivity.class); break; case R.id.txt_zcgl: intentAction(getActivity(), ZcglActivity.class); break; case R.id.txt_tzgl: intentAction(getActivity(), TzglActivity.class); break; case R.id.txt_jlcx: intentAction(getActivity(), JlcxActivity.class); break; case R.id.txt_wdyhk: intentAction(getActivity(), MyBankCardActivity.class); break; case R.id.txt_wdxx: intentAction(getActivity(), MyMessageActivity.class); break; case R.id.txt_myredpager: intentAction(getActivity(), MyRedPagerActivity.class); break; case R.id.layout_zhaq: intentAction(getActivity(), CertificateActivity.class); break; case R.id.layout_ssmm: boolean isHasGesturePsd = SharePreferenceUtil.getInstance(getActivity().getApplicationContext()) .isHasGesturePsd(); if (isHasGesturePsd) { showDialog(); } else { intentAction(getActivity(), GesturePsdActivity.class); } break; } }