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 6129703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:46:25+00:00 2026-05-23T16:46:25+00:00

Anyone knows any efficient method of perform an animation that what is has to

  • 0

Anyone knows any efficient method of perform an animation that what is has to do is to display a text, character by character? Like:

T
Th
Thi
This
This i
This is
…

And so on.

Thanks!

  • 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-05-23T16:46:25+00:00Added an answer on May 23, 2026 at 4:46 pm

    This may not be the most elegant solution, but the simplest is probably a quick subclass of TextView with a Handler that updates the text every so often until the complete sequence is displayed:

    public class Typewriter extends TextView {
    
        private CharSequence mText;
        private int mIndex;
        private long mDelay = 500; //Default 500ms delay
        
        
        public Typewriter(Context context) {
            super(context);
        }
        
        public Typewriter(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
        
        private Handler mHandler = new Handler();
        private Runnable characterAdder = new Runnable() {
            @Override
            public void run() {
                setText(mText.subSequence(0, mIndex++));
                if(mIndex <= mText.length()) {
                    mHandler.postDelayed(characterAdder, mDelay);
                }
            }
        };
        
        public void animateText(CharSequence text) {
            mText = text;
            mIndex = 0;
            
            setText("");
            mHandler.removeCallbacks(characterAdder);
            mHandler.postDelayed(characterAdder, mDelay);
        }
        
        public void setCharacterDelay(long millis) {
            mDelay = millis;
        }
    }
    

    You can then use this in an Activity like so:

    public class MyActivity extends Activity {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            Typewriter writer = new Typewriter(this);
            setContentView(writer);
    
            //Add a character every 150ms
            writer.setCharacterDelay(150);
            writer.animateText("Sample String");
        }
    }
    

    If you want some animation effects with each letter added, perhaps look at subclassing TextSwitcher instead.

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

Sidebar

Related Questions

anyone knows any java utility method that would convert windows paths to DOS 8.3
I was wondering whether anyone knows of any tools available that perform the task
Anyone knows any free Visual Studio add-in that would find and/or delete dead (unused)
Does anyone knows any free alternative MySQL Enterprise Monitor? I need some tool, that
does anyone knows any good resources and articles that can explain how to create
Anyone knows that any jQuery plugins or to build something similar to image effect/gallery
I was wondering if anyone knows of any large sites that use progressive enhancement/CSS3?
I was curious if anyone knows of any good examples of plugins that I
I'm curious if anyone knows of any downloadable Objective C sample code for the
I was wondering if anyone knows of any good Open Source distributed computing projects?

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.