title: Call decryption method from one activity to adapter
body: <p>I would like to ask how to call my decryption method from one activity to another(Adapter).</p>
  
  <p>MessageActivity.java here is my decryption method:</p>
  
  <pre><code>  private String AESDecriptionMetod(String string) throws UnsupportedEncodingException {
      byte[] EncriptedByte = string.getBytes("ISO-8859-1");
      String decryptedString = string;
  
      byte[] decryption;
  
      try {
          decipher.init(cipher.DECRYPT_MODE, secretKeySpec);
          decryption = decipher.doFinal(EncriptedByte);
          decryptedString = new String(decryption);
      } catch (InvalidKeyException e) {
          e.printStackTrace();
      } catch (BadPaddingException e) {
          e.printStackTrace();
      } catch (IllegalBlockSizeException e) {
          e.printStackTrace();
      }
  
      return decryptedString;
  }
  </code></pre>
  
  <p>MessageAdapter.java where I want to call decryption method:</p>
  
  <pre><code>@Override
  public void onBindViewHolder(@NonNull MessageAdapter.ViewHolder holder, int position) {
  
      Chat chat = mChat.get(position);
  
  
      stringMessage = chat.getMessage().toString();
      stringMessage = stringMessage.substring(1, stringMessage.length()-1);
  
      String[] stringMessageArrey = stringMessage.split(", ");
      Arrays.sort(stringMessageArrey);
      String[] stringFinal = new String[stringMessageArrey.length];
  
      for(int i = 0; i&lt;stringMessageArrey.length; i++){
          String[] stringKeyValue = stringMessageArrey[i].split("=", 2);
          try {
              stringFinal[i]= AESDecriptionMetod(stringKeyValue[1]);
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          }
          return stringFinal.toString();
  
  
      }
  
      holder.show_message.setText(stringFinal);
  
      if (imageurl.equals("default")){
          holder.profile_image.setImageResource(R.mipmap.ic_launcher);
      } else {
          Glide.with(mContext).load(imageurl).into(holder.profile_image);
      }
  
  
  }
  </code></pre>
  
  <p>And how to implement stringFinal in holder.show_message.setText(  ???  );</p>
  
  <p>Thanks for any answer! </p>