Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I show a value on the screen without blocking the UI and make it fade out with style in android activity?
    primarykey
    data
    text
    <p>I'm making a word game for android, and basically whenever a user enters something right I'm updating the score in the application, and I want to show the score on the screen to make it show in big then fade out slowly and get smaller, how can I do that? and is it possible to implement it in an AsyncTask class? This is the method I'm using to check if the word entered is right.</p> <pre><code> public class checkWord extends AsyncTask&lt;String, String, Void&gt; { private String c; @Override protected Void doInBackground(String... arg0) { int size = correctWords.size(); String word = arg0[0]; for (int i = 0; i &lt; size; i++) { if (word.equalsIgnoreCase(correctWords.get(i))) { publishProgress("bad"); } } try { c = bufferedReader.readLine(); while (c != null &amp;&amp; !c.equalsIgnoreCase(word)) { c = bufferedReader.readLine(); } if (c != null) { correctWords.add(0, word); score += word.length(); publishProgress("good"); } else { incorrectWords.add(0, word); publishProgress("bad"); } } catch (IOException e) { e.printStackTrace(); } closeWordFile(); openWordFile(); return null; } </code></pre> <p>So is there anyway I could pass a param to the publishProgress so that in onProgressUpdate I draw the score they got, for example +3 then make it fade out? This is my onProgressUpdate where I add seconds to the timer and play a sound if it's a valid word or not</p> <pre><code> @Override protected void onProgressUpdate(String... values) { super.onProgressUpdate(values); if (values[0].matches("bad")) failureSound.start(); if (values[0].matches("good")) { successSound.start(); if (countDownTimer != null) { countDownTimer.cancel(); startTimer(countDownTime + c.length() / 2); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload