@Override public void onClick(View inButton) { boolean isErr = false; if (mTitle.getText().toString().length() == 0) { mTitle.setError("Required"); mTitle.setEms(10); isErr = true; } if (mDesc.getText().toString().length() == 0) { mDesc.setActivated(true); mDesc.setError("Required"); isErr = true; } if (inButton.getId() == openWeb.getId()) web.setVisibility(View.VISIBLE); else if (inButton.getId() == mAvail.getId()) startActivity(new Intent(this, CheckActivity.class)); else if (inButton.getId() == mBack.getId()) finish(); else if (inButton.getId() == mSub.getId()) { AlertDialog.Builder al = new AlertDialog.Builder(this); if (isErr) return; else al.setTitle("Continue?") .setIcon(R.drawable.ornament) .setMessage("Your listing is going to be submitted to your chosen category.") .setPositiveButton( "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface d, int x) { payment = new ArrayList<String>(); if (mCard.isChecked()) payment.add("Card"); if (mCheck.isChecked()) payment.add("Check"); if (mOnline.isChecked()) payment.add("Online"); if (mCash.isChecked()) payment.add("Cash"); // Toast.makeText(getApplicationContext(), payment.toString(), // Toast.LENGTH_LONG).show(); Intent intent = new Intent(getApplicationContext(), StartActivity.class); intent.putExtra("Payment", payment); intent.putExtra("Category", mChosenCategory); intent.putExtra("Title", mTitle.getText().toString()); intent.putExtra("Price", mPrice.getText().toString()); intent.putExtra("Description", mDesc.getText().toString()); intent.putExtra("Location", mLocation.getText().toString()); intent.putExtra("Photo", jpegData); startActivity(intent); } }) .setNegativeButton( "Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface d, int x) {} }) .show(); } else startActivityForResult( new Intent(this, com.lightbox.android.camera.activities.Camera.class), REQ); }
/** Called when the user selects the Send button */ public void sendMessage(View view) { Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.edit_message); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); }
@Override public void onExprItemClick(String exprInfo, boolean isDel) { SpannableString ss; int textSize = (int) editText.getTextSize(); if (isDel) { HashMap<String, Integer> mExprFilenameIdData = XWExpressionManager.getInstance().getmExprInfoIdValuesCN(getActivity()); ss = XWExpressionUtil.generateSpanComment( getActivity().getApplicationContext(), XWExpressionUtil.deleteOneWord(editText.getText().toString(), mExprFilenameIdData), textSize); } else { String content = editText.getText() + exprInfo; ss = XWExpressionUtil.generateSpanComment( getActivity().getApplicationContext(), content, textSize); } editText.setText(ss); editText.setSelection(ss.length()); }
@OnClick(R.id.comment_sendbtn) public void senAction() { String infoid = getArguments().getString("infoid"); String userid = getArguments().getString("userid"); String commentid = getArguments().getString("commentid"); String content = editText.getText().toString().trim(); if (TextUtils.isEmpty(content)) { showToast("请输入内容"); return; } KeyboardUtil.hideSoftInput(getActivity()); if (isCompanyCircle) { companyZoneCommentSub(infoid, userid, commentid, content); } else { String infouserid = getArguments().getString("infouserid"); friendZoneCommentSub(infoid, userid, commentid, content, infouserid); } }