Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:42:44+00:00 2026-06-03T11:42:44+00:00

I am creating a runnable typewriter effect using a textview inside a scrollview. this

  • 0

I am creating a runnable typewriter effect using a textview inside a scrollview.

this is what I did…

    final ScrollView sv = new ScrollView(this);
    sv.setLayoutParams(new LinearLayout.LayoutParams((int)display.getWidth()/2, (int)((display.getHeight()/4))*3));
    sv.setPadding(0, px2DP(10), px2DP(10), px2DP(10));

    final CharSequence text = getResources().getText(R.string.longstring);

    final TextView content = new TextView(this);
    content.setBackgroundColor(getResources().getColor(R.color.Black));
    content.setTextColor(getResources().getColor(R.color.White));
    content.setTextSize(TypedValue.COMPLEX_UNIT_SP,20);
    content.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

    sv.addView(content);

    content.postDelayed(new Runnable(){
        @Override
        public void run() {
            content.append(text.subSequence(0, index++));
            sv.fullScroll(View.FOCUS_DOWN);     
        }

    },70);

I am only getting a black box and no text.

What am I doing wrong? Please help.

PS. I already found the solution!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:42:45+00:00Added an answer on June 3, 2026 at 11:42 am

    Solution found. I am using the handler-runnable concept wrong. Based on what Jonas pointed out, Runnable only runs once. Therefore a loop is necessary.

    As suggested on this link:
    How to run a Runnable thread in Android?

    The answer is something similar to recursion.

    Anyway thanks guys! Android is so cool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why we need to pass the runnable instance while creating the threads using the
I faced this issue, while trying to autowire a runnable class and creating different
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
Creating a simple RPG game, first time using XNA. Trying to get my character
When creating a new service in a WCF service project, Visual Studio will automatically
I am interested in creating a 2D drawing application for Android using touch input.
I'm creating an application in Swing using NetBeans. I would like to be able
The Java docs state that if we supplied a Runnable target when creating a
I have created an applet program using Eclipse IDE. Now im creating .html file
I'm creating a Java Slideshow using some 2DTransitions I found on the net. Everything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.