code: public static String getText(Activity context, int id) {
          TextView view = findViewById(context, id);
  
          String text = "";
          if (view != null) {
              text = view.getText().toString();
          } else {
              Log.e("Caffeine", "Null view given to getText().  \"\" will be returned.");
          }
          return text;
      }
docs: Get text as String from EditView.
  <b>Note:</b> returns "" for null EditText, not a NullPointerException
  
  @param context The current Context or Activity that this method is called from.
  @param id      Id for the TextView/EditView to get text from.
  @return the text