How to show multiple images one after another in imageview dynamically in android -


Sir I am creating an app in which I have an activity where I will enter a sentence in the editing text box and my code Divide it into characters and then I should be shown in the same pattern according to the same picture as the same picture as each letter, from which sentences are made of characters. Now I do not know what technology I should use. One of my seniors asked me to use multi threading but I do not know how to code ... can you give me some hints? Please. About the final project of my MCS and we have not studied Android in our course work, I am doing it on my own. Really need some help.

If you want to display your characters after each other i.e. after the next letter disappears The next letter will appear on the screen, for this, you will need basic multithreading.

When you repeat the letters of your sentence on a separate thread, you need to make changes to the UI thread

Assume that you have your string variable str

string str = "YourSentence";

To cross your punishment, create a new thread in a loop. Update each recurrence of this loop using ImageView on UI thread, runOnUIthread () and then insert thread to sleep

Here's how your thread body looks.

  threads t = new thread () {run for public null () (for int i = 0; i & lt; str.length (); i ++) {final intestine H = run; RunOnUiThread (new runnab) (last bitmap bmpLetter = MainActivity.this.getBitmapFromAsset (str.charAt (j) + ".jpg"); myImageView.setImageBitmap (bmpLetter);}}); try {Sleep (1000);} Grip (Shown Iksepshn e) {e.printStackTrace ();}}}};  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -