title: I am getting this error find view by id(int) in appcompatActivity cannot be applied to () and it comes on line 65
body: <p>I am getting this error find view by id(int) in appcompatActivity cannot be applied to () and it comes on line 65. I don't know how to fix it. I am calling data from firebase firestore and i am trying to print that value in the text view.</p>
  <pre><code>package net.simplifiedlearning.firebaseauth;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Context;
  import android.content.Intent;
  import android.content.SharedPreferences;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.google.android.gms.tasks.OnCompleteListener;
  import com.google.android.gms.tasks.Task;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.firestore.DocumentReference;
  import com.google.firebase.firestore.DocumentSnapshot;
  import com.google.firebase.firestore.FirebaseFirestore;
  
  public class ProfileActivity extends AppCompatActivity implements View.OnClickListener {
      FirebaseDatabase database = FirebaseDatabase.getInstance();
      FirebaseFirestore db = FirebaseFirestore.getInstance();
  
      final String MyPREFERENCES = &quot;MyPrefs&quot;;
  
  
      Button AddChoreButton;
      TextView totalPoints;
      SharedPreferences sharedpreferences;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_profile);
  
          AddChoreButton = (Button) findViewById(R.id.AddChoreButton);
          totalPoints = (TextView) findViewById(R.id.totalPoints);
  
  
          findViewById(R.id.AddChoreButton).setOnClickListener(this);
  
          preparepointdata();
  
      }
  
      private void preparepointdata() {
          final String MyPREFERENCES = &quot;MyPrefs&quot;;
  
          sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
          String parentEmail = sharedpreferences.getString(&quot;parentEmail&quot;, null);
          String username = sharedpreferences.getString(&quot;username&quot;, null);
  
          db.collection(&quot;profiles&quot;).document(username)
                  .get().addOnCompleteListener(new OnCompleteListener&lt;DocumentSnapshot&gt;() {
              @Override
              public void onComplete(@NonNull Task&lt;DocumentSnapshot&gt; task) {
                  if (task.isSuccessful()) {
                      DocumentSnapshot document = task.getResult();
                      if (document.exists()) // if username is present
                      {
                           findViewById().setText(document.getData().get(&quot;totalPoints&quot;).toString());//id of textView
                      } else {
  
                          //add code (user not found/registered)
                      }
                          } else {
                          }
                      }
                  });
      }
  
  
      @Override
      public void onClick(View view) {
          switch (view.getId()) {
              case R.id.AddChoreButton:
                  startActivity(new Intent(ProfileActivity.this, AddChoreActivity.class));
          }
      }
  }
  </code></pre>
  <p>the line that has an error is this line <code>findViewById().setText(document.getData().get(&quot;totalPoints&quot;).toString());//id of textView</code>. Please offer solutions if you can. Thank you</p>