code: public final AlertDialog shareText(CharSequence text, CharSequence type) {
      Intent intent = new Intent();
      intent.addCategory(Intent.CATEGORY_DEFAULT);
      intent.setAction(BS_PACKAGE + ".ENCODE");
      intent.putExtra("ENCODE_TYPE", type);
      intent.putExtra("ENCODE_DATA", text);
      String targetAppPackage = findTargetAppPackage(intent);
      if (targetAppPackage == null) {
        return showDownloadDialog();
      }
      intent.setPackage(targetAppPackage);
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      intent.addFlags(FLAG_NEW_DOC);
      attachMoreExtras(intent);
      if (fragment == null) {
        activity.startActivity(intent);
      } else {
        fragment.startActivity(intent);
      }
      return null;
    }
docs: Shares the given text by encoding it as a barcode, such that another user can
  scan the text off the screen of the device.
  
  @param text the text string to encode as a barcode
  @param type type of data to encode. See {@code com.google.zxing.client.android.Contents.Type} constants.
  @return the {@link AlertDialog} that was shown to the user prompting them to download the app
  if a prompt was needed, or null otherwise