How to fix slow loading time while loading long text in Textview?Firebase listeners first time invocation takes timeHow do I center text horizontally and vertically in a TextView?Strange out of memory issue while loading an image to a Bitmap objectWhy is the Android emulator so slow? How can we speed up the Android emulator?Auto Scale TextView Text to Fit within BoundsHow do I fix android.os.NetworkOnMainThreadException?How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor versionGet children using orderByChild-equalsTo in Firebase-AndroidAdding Social Media Share Logic From Firebase in AndroidUpdated global variables does not reflect inside ValueEventListener's onCancelled methodHow to get the data saved in a USER_ID?

Can fluent English speakers distinguish “steel”, “still” and “steal”?

Can I call 112 to check a police officer's identity in the Czech Republic?

Single word for "refusing to move to next activity unless present one is completed."

How do Windows version numbers work?

Shortest distance around a pyramid?

If the railway suggests a 5-min connection window for changing trains in the Netherlands, does that mean it's definitely doable?

What's the maximum time an interrupt service routine can take to execute on atmega328p?

<schwitz>, <zwinker> etc. Does German always use 2nd Person Singular Imperative verbs for emoticons? If so, why?

Extract an attribute value from XML

Is Trump personally blocking people on Twitter?

Is Arc Length always irrational between two rational points?

Cops: The Hidden OEIS Substring

Why are Hobbits so fond of mushrooms?

Is purchasing foreign currency before going abroad a losing proposition?

Why were Er and Onan punished if they were under 20?

Was I subtly told to resign?

Storming Area 51

What explains 9 speed cassettes price differences?

Is there any word for "disobedience to God"?

Simple LED driver, transistor and GPIO

The monorail explodes before I can get on it

Machine learning and operations research projects

How can one write good dialogue in a story without sounding wooden?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?



How to fix slow loading time while loading long text in Textview?


Firebase listeners first time invocation takes timeHow do I center text horizontally and vertically in a TextView?Strange out of memory issue while loading an image to a Bitmap objectWhy is the Android emulator so slow? How can we speed up the Android emulator?Auto Scale TextView Text to Fit within BoundsHow do I fix android.os.NetworkOnMainThreadException?How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor versionGet children using orderByChild-equalsTo in Firebase-AndroidAdding Social Media Share Logic From Firebase in AndroidUpdated global variables does not reflect inside ValueEventListener's onCancelled methodHow to get the data saved in a USER_ID?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















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?










share|improve this question
























  • Use background thread to do fetch data and after getting data assign text to textview.

    – Faisal
    Mar 26 at 3:44











  • @Faisal, and how to write it? can you share the code?

    – Hentai Sama
    Mar 26 at 4:51











  • [Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

    – Hentai Sama
    Mar 26 at 5:03











  • cool. have a good day

    – Faisal
    Mar 26 at 5:22











  • Check this out.

    – Alex Mamo
    Mar 26 at 10:21

















0















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?










share|improve this question
























  • Use background thread to do fetch data and after getting data assign text to textview.

    – Faisal
    Mar 26 at 3:44











  • @Faisal, and how to write it? can you share the code?

    – Hentai Sama
    Mar 26 at 4:51











  • [Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

    – Hentai Sama
    Mar 26 at 5:03











  • cool. have a good day

    – Faisal
    Mar 26 at 5:22











  • Check this out.

    – Alex Mamo
    Mar 26 at 10:21













0












0








0


1






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?










share|improve this question
















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?







java android firebase






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 8:34









Zoe

16.3k9 gold badges63 silver badges95 bronze badges




16.3k9 gold badges63 silver badges95 bronze badges










asked Mar 26 at 3:39









Hentai SamaHentai Sama

1




1












  • Use background thread to do fetch data and after getting data assign text to textview.

    – Faisal
    Mar 26 at 3:44











  • @Faisal, and how to write it? can you share the code?

    – Hentai Sama
    Mar 26 at 4:51











  • [Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

    – Hentai Sama
    Mar 26 at 5:03











  • cool. have a good day

    – Faisal
    Mar 26 at 5:22











  • Check this out.

    – Alex Mamo
    Mar 26 at 10:21

















  • Use background thread to do fetch data and after getting data assign text to textview.

    – Faisal
    Mar 26 at 3:44











  • @Faisal, and how to write it? can you share the code?

    – Hentai Sama
    Mar 26 at 4:51











  • [Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

    – Hentai Sama
    Mar 26 at 5:03











  • cool. have a good day

    – Faisal
    Mar 26 at 5:22











  • Check this out.

    – Alex Mamo
    Mar 26 at 10:21
















Use background thread to do fetch data and after getting data assign text to textview.

– Faisal
Mar 26 at 3:44





Use background thread to do fetch data and after getting data assign text to textview.

– Faisal
Mar 26 at 3:44













@Faisal, and how to write it? can you share the code?

– Hentai Sama
Mar 26 at 4:51





@Faisal, and how to write it? can you share the code?

– Hentai Sama
Mar 26 at 4:51













[Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

– Hentai Sama
Mar 26 at 5:03





[Solved] Someone's from facebook suggest me this github.com/metalurgus/LongTextView and it's work. thanks!

– Hentai Sama
Mar 26 at 5:03













cool. have a good day

– Faisal
Mar 26 at 5:22





cool. have a good day

– Faisal
Mar 26 at 5:22













Check this out.

– Alex Mamo
Mar 26 at 10:21





Check this out.

– Alex Mamo
Mar 26 at 10:21












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349517%2fhow-to-fix-slow-loading-time-while-loading-long-text-in-textview%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349517%2fhow-to-fix-slow-loading-time-while-loading-long-text-in-textview%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh