Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case R.id.send:
- showAlertMessage("Would you like to send?", 1);
- public void showAlertMessage(String message, final int type) {
- final AlertDialog d1 = new AlertDialog.Builder(this).create();
- d1.setMessage(message);
- d1.setButton("Yes", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(final DialogInterface dialog, final int which) {
- if(type == 2){
- hideKeyboard(composeMsgEditText);
- hideKeyboard(completionView);
- finish();
- }
- else if(type == 1){
- hideKeyboard(composeMsgEditText);
- hideKeyboard(completionView);
- addToRecipients();
- if(isAskForFeedback){
- if(isGroupSelected){
- sendAskFeedback();
- }
- else{
- saveEmailGroup();
- }
- }
- else{
- sendFeedback();
- }
- }
- else if(type == 3){
- clearFields();
- }
- dialog.dismiss();
- }
- });
- d1.setButton2("No", new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- }
- });
- d1.setCancelable(true);
- d1.show();
- }
- rivate void sendFeedback(){
- thread.setUserId(userId);
- thread.setToAddresses(createToAddress().toString());
- thread.setType(MessageThread.OUT_MESSAGE);
- thread.setRandomcode(StringUtility.generateRandomDigits(6));
- thread.setOwned(true);
- thread.setRequestor(userId);
- thread.setThreadTopic(composeMsgEditText.getText().toString());
- thread.setThreadId("54e5cb1a1c19016a0ddcc27e");
- thread.setSolicitationId("54e5cb1a1c19016a0ddcc27e");
- thread.setHashcode(HashUtility.encryptString(thread.getRandomcode() + thread.getUserId()));
- thread.setStrippedHashCode(StringUtility.reduceToBytes(thread.getHashcode(), 16));
- try {
- thread.setThreadTopicEnc(EncryptionUtility.encrypt(thread.getThreadTopic(), thread.getStrippedHashCode()));
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- } catch (NoSuchPaddingException e) {
- e.printStackTrace();
- } catch (InvalidKeyException e) {
- e.printStackTrace();
- } catch (IllegalBlockSizeException e) {
- e.printStackTrace();
- } catch (BadPaddingException e) {
- e.printStackTrace();
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- } catch (InvalidKeySpecException e) {
- e.printStackTrace();
- } catch (InvalidAlgorithmParameterException e) {
- e.printStackTrace();
- }
- thread.setRandomcode(StringUtility.generateRandomDigits(6));
- threadDBAction.save(thread);
- CreateThreadAsyncTask asyncTask = new CreateThreadAsyncTask(this, this, true, thread, userId, false);
- asyncTask.execute();
- SelectFeedBckorAskFeedbackActivity.selectFeedBckorAskFeedbackActivity.finish();
- SelectFeedbackTypeActivity.selectFeedbackTypeActivity.finish();
- finish();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement