3 votes

Données FireStore non affichées Accès à la méthode cachée Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)

Lorsque j'essaie de récupérer des données de Firestore en utilisant FirestoreRecyclerAdapter ça ne se voit pas.

Journal des erreurs

Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)

Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)

Code Java

    //FirebaseFireStore Variable
    firebaseFirestore = FirebaseFirestore.getInstance();
    //RecyclerView Variable
    recyclerView = findViewById(R.id.recyclerViewId);
    //Query
    Query query = firebaseFirestore.collection("root");
    //RecyclerOption
    FirestoreRecyclerOptions<TestModel> options = new FirestoreRecyclerOptions.Builder<TestModel>()
            .setQuery(query, TestModel.class)
            .build();
    //FirestoreRecyclerAdapter
    adapter = new FirestoreRecyclerAdapter<TestModel, MyTestViewHolder>(options) {
        @NonNull
        @Override
        public MyTestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.test_item, parent, false);
            return new MyTestViewHolder(view);
        }
        @Override
        protected void onBindViewHolder(@NonNull TestActivity.MyTestViewHolder holder, int position, @NonNull TestModel model) {
            holder.tit.setText(model.getmTitle());
            holder.sto.setText(model.getmStory());
        }
    };
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
}
private class MyTestViewHolder extends RecyclerView.ViewHolder {
    TextView tit, sto;
    public MyTestViewHolder(@NonNull View itemView) {
        super(itemView);
        tit = itemView.findViewById(R.id.testTitleId);
        sto = itemView.findViewById(R.id.testStoryId);
    }
}
@Override
protected void onStart() {
    super.onStart();
    adapter.startListening();
}
@Override
protected void onStop() {
    super.onStop();
    adapter.stopListening();
}

ModèleClasse

 String mTitle, mStory;

public TestModel(String mTitle, String mStory) {
    this.mTitle = mTitle;
    this.mStory = mStory;
}

private TestModel(){}

public String getmTitle() {
    return mTitle;
}

public void setmTitle(String mTitle) {
    this.mTitle = mTitle;
}

public String getmStory() {
    return mStory;
}

public void setmStory(String mStory) {
    this.mStory = mStory;
}

FireStore Concole

Image

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X