diff --git a/app/src/main/java/com/margsapp/messenger/Adapter/MessageAdapter.java b/app/src/main/java/com/margsapp/messenger/Adapter/MessageAdapter.java index 368aa21..e7a5c2b 100644 --- a/app/src/main/java/com/margsapp/messenger/Adapter/MessageAdapter.java +++ b/app/src/main/java/com/margsapp/messenger/Adapter/MessageAdapter.java @@ -42,16 +42,16 @@ public class MessageAdapter extends RecyclerView.Adapter mChat, String imageUrl,SharedPreferences sharedPreferences) { + + public MessageAdapter(Context mContext, List mChat, String imageUrl) { this.mContext = mContext; this.mChat = mChat; this.imageUrl = imageUrl; - this.sharedPreferences = sharedPreferences; + } diff --git a/app/src/main/java/com/margsapp/messenger/Main/MessageActivity.java b/app/src/main/java/com/margsapp/messenger/Main/MessageActivity.java index 11ac77e..726d1fe 100644 --- a/app/src/main/java/com/margsapp/messenger/Main/MessageActivity.java +++ b/app/src/main/java/com/margsapp/messenger/Main/MessageActivity.java @@ -819,7 +819,6 @@ public void onCancelled(@NonNull DatabaseError error) { private void readMessage(String myid, String userid, String imageUrl){ mchat = new ArrayList<>(); - SharedPreferences sharedPreferences = getSharedPreferences("ReadRecipents", 0); databaseReference = FirebaseDatabase.getInstance().getReference("Chats"); databaseReference.keepSynced(true); databaseReference.addValueEventListener(new ValueEventListener() { @@ -837,7 +836,7 @@ public void onDataChange(@NonNull DataSnapshot snapshot) { - messageAdapter = new MessageAdapter(MessageActivity.this, mchat, imageUrl,sharedPreferences); + messageAdapter = new MessageAdapter(MessageActivity.this, mchat, imageUrl); recyclerView.setAdapter(messageAdapter);