public void handleMessage(Message msg) { UIManager.toggleDialog(loadDialog); switch (msg.what) { case ConstantManager.SUCCESS_1: { String userId = (String) msg.obj; HashMap<String, Object> map = new HashMap<String, Object>(); map.put("userId", userId); LogManager.e("xx", "我发送了userid" + userId); UIManager.switcher(RPerfectDataActivity.this, RShareActivity.class, map); break; } case ConstantManager.FAIL_SERVER_ERROR: case ConstantManager.FAIL_NO_NET: { ToastManager.show(RPerfectDataActivity.this, R.string.toast_un_net); break; } case ConstantManager.LOADING_1: { loadDialog = UIManager.getLoadingDialog(RPerfectDataActivity.this); loadDialog.show(); break; } case ConstantManager.SHOW_PHOTO: { Bitmap bm = (Bitmap) msg.obj; if (bm == null) { } else { new RoundedBitmapDisplayer(100).display(bm, (ImageAware) mHeadIV, null); isSetHead = true; } if (bm != null && !bm.isRecycled()) { bm.recycle(); } break; } } }
public void onClick(View v) { switch (v.getId()) { case R.id.title_next_ll: { nickName = StringManager.getStringByET(mNickName); if (StringManager.isEmpty(nickName)) { ToastManager.show(this, R.string.toast_nickname_empty); return; } if (!isSetHead) { ToastManager.show(this, R.string.toast_head_empty); return; } // //要传递的数据, HashMap<String, Object> map = new HashMap<String, Object>(); // map.put("openid", "qq 第三方登录的唯一编号");//如果是第三方登录,加入唯一授权的唯一编码 // map.put("uid", "weibo 第三方登录的唯一编号"); Intent i = getIntent(); DataService.sendRegisterUserInfo( i.getStringExtra("cellphone"), i.getStringExtra("pwd"), nickName, DataService.unParsePost(mPost.getText().toString().trim()), DataService.unParseGender(mSex.getText().toString().trim()), 10.10, 22.22, MediaManager.cropPhotoFile, handler); break; } case R.id.action_sheet_photo_camera_bt: { MediaManager.getPhotoFromCamera(this); dialog.dismiss(); break; } case R.id.action_sheet_photo_album_bt: { MediaManager.getPhotoFromAlbum(this); dialog.dismiss(); break; } case R.id.perfect_data_head: { View view = View.inflate(this, R.layout.layout_actionsheet_up_head, null); dialog = UIManager.getActionSheet(this, view); dialog.show(); break; } case R.id.perfect_data_post_rl: { AlertDialog.Builder builder = new AlertDialog.Builder(this); // 1=控球后卫 2=得分后卫 3=小前锋 4=大前锋 5=中锋 final String[] objects = {"控球后卫", "得分后卫", "小前锋", "大前锋 ", "中锋"}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, objects); builder.setAdapter( adapter, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mPost.setText(objects[which]); } }); builder.create().show(); break; } case R.id.perfect_data_sex_rl: { AlertDialog.Builder builder = new AlertDialog.Builder(this); final String[] objects = {"男", "女"}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, objects); builder.setAdapter( adapter, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mSex.setText(objects[which]); } }); builder.create().show(); break; } } }