I have a textview that will load a long text (5.694 characters) from Firebase, and it makes the activity freeze for about 4 seconds until it displays the whole text.
This is my code:
root = FirebaseDatabase.getInstance().getReference();
parent = root.child("mainland");
parent.child("main").child("name").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
String value = dataSnapshot.getValue(String.class);
name.setText(value);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
is there a way to make the loading time faster, or maybe is there a library just like glide for textview or something?