title: Android/FireStore QuerySnapshot convert to CustomObject
body: <p>I am currently programin a test QuizApp. The gameplay is pretty easy I just want an online database of questions and a user can answer them. <br/><br/>
  This is what the database looks like:<br/>
  <a href="https://i.stack.imgur.com/pvDcQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pvDcQ.png" alt="enter image description here"></a>
  <br/><br/>
  That collection questions contains an unique ID and a custom Object (questionObject) named 'content'. The number is only something easy I can query/search for. <br/><br/>
  This is my questionAdder and query UI. It's only a small test App. <br/><br/>
      public class questionAdder extends AppCompatActivity {</p>
  
  <pre><code>EditText pQuestion, pAnwerA, pAnswerB, pAnswerC, pAnswerD, number;
  Button pAdd, query;
  private DatabaseReference databaseReference;
  private FirebaseFirestore firebaseFirestore;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.addquestion);
  
      firebaseFirestore = FirebaseFirestore.getInstance();
  
      pQuestion = (EditText) findViewById(R.id.question);
      pAnwerA = (EditText) findViewById(R.id.answerA);
      pAnswerB = (EditText) findViewById(R.id.answerB);
      pAnswerC = (EditText) findViewById(R.id.answerC);
      pAnswerD = (EditText) findViewById(R.id.answerD);
      number = (EditText) findViewById(R.id.number);
  
      pAdd = (Button) findViewById(R.id.addQuestion);
      pAdd.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              readQuestionStore();
          }
      });
  
      query = (Button) findViewById(R.id.query);
      query.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              CollectionReference questionRef = firebaseFirestore.collection("questions");
              questionRef.whereEqualTo("content.number", "20").get().addOnSuccessListener(new OnSuccessListener&lt;QuerySnapshot&gt;() {
                  @Override
                  public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
                      questionObject pContent = queryDocumentSnapshots.toObjects(questionObject.class);
                  }
              });
          }
      });
  
  }
  
  public void readQuestionStore(){
  
      Map&lt;String, Object&gt; pContent = new HashMap&lt;&gt;();
      pContent.put("question", pQuestion.getText().toString());
      pContent.put("Corr Answer", pAnwerA.getText().toString());
      pContent.put("AnswerB", pAnswerB.getText().toString());
      pContent.put("AnswerC", pAnswerC.getText().toString());
      pContent.put("AnswerD", pAnswerD.getText().toString());
      questionObject content = new questionObject(pContent, number.getText().toString()); //document("Essen").collection("Katalog")
  
      firebaseFirestore.collection("questions").add(content).addOnSuccessListener(new OnSuccessListener&lt;DocumentReference&gt;() {
          @Override
          public void onSuccess(DocumentReference documentReference) {
              Toast.makeText(questionAdder.this, "Klappt", Toast.LENGTH_LONG).show();
          }
      }).addOnFailureListener(new OnFailureListener() {
          @Override
          public void onFailure(@NonNull Exception e) {
              Toast.makeText(questionAdder.this, "Klappt nicht", Toast.LENGTH_LONG).show();
          }
      });
  }
  </code></pre>
  
  <p>}</p>
  
  <p><br/><br/>
  And this is how my questionObject looks like:
  <br/><br/>
      public class questionObject{</p>
  
  <pre><code>private Map&lt;String, Object&gt; content;
  private String number;
  
  public questionObject(){
  
  }
  
  public questionObject(Map&lt;String, Object&gt; pContent, String pNumber) {
      this.content = pContent;
      this.number = pNumber;
  }
  
  public Map&lt;String, Object&gt; getContent() {
      return content;
  }
  
  public void setContent(Map&lt;String, Object&gt; content) {
      this.content = content;
  }
  
  public String getNumber() {
      return number;
  }
  
  public void setNumber(String number) {
      this.number = number;
  }
  </code></pre>
  
  <p>}</p>
  
  <p><br/><br/>
  <strong>Problem</strong> In that questionAdder class in the onClickListener I receive an "incompatible types" Error (Found: java.utils.list Required: questionObject).<br/><br/></p>
  
  <pre><code>query.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  CollectionReference questionRef = firebaseFirestore.collection("questions");
                  questionRef.whereEqualTo("content.number", "20").get().addOnSuccessListener(new OnSuccessListener&lt;QuerySnapshot&gt;() {
                      @Override
                      public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
                          questionObject pContent = queryDocumentSnapshots.toObjects(questionObject.class);
                      }
                  });
              }
          });
  </code></pre>
  
  <p>If if I change that to a List it is empty. So the actual question is, how do I get the CustomObject into my code using the Database. Thanks!</p>