How to set decrement counter in textview?
<p>Currently, I'm developing pattern lock application. In my application when user enter wrong pattern on that time pattern lock activity delay 30 second. And I am adding one textview on pattern lock activity that can display only text like &quot;Please Wait 30 Seconds&quot;. So I want to replace that text &quot;Please Wait 30 Seconds&quot; in to the decrement counter.</p>
<p><strong>Example:</strong> 30-29-28-27-----0 (automatically decrement counter value)</p>
<p>Here this my Textview xml:</p>
<pre><code>  &lt;TextView
    android:id=&quot;@+id/txtMessage&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:text=&quot;Please Wait 30 Seconds&quot;
    android:gravity=&quot;center&quot;
    android:textSize=&quot;25dp&quot;
    android:textColor=&quot;@color/colorAccent&quot;
    android:visibility=&quot;gone&quot;/&gt;
</code></pre>
<p>See <code> android:text=&quot;Please Wait 30 Seconds&quot;</code> where I want to set decrement counter</p>
<p>This my activity code:</p>
<pre><code> private void invalidPattern() {

    failedCount ++;

    if (failedCount &gt; LIMIT) {

        lock9View.setVisibility(View.GONE);
        txtMessage.setVisibility(View.VISIBLE);
        Animation zoomOutAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.animation);
        txtMessage.startAnimation(zoomOutAnimation);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                //reset the failed count
                failedCount = 0;
                lock9View.setVisibility(View.VISIBLE);
                txtMessage.setVisibility(View.GONE);
                //Enable the input interface here
            }
        }, 30000); // 30Sec delay
    }
    else
    {
        Log.i(&quot;Wrong....&quot;, &quot;aa..else.....invalidPattern()&quot;);
    }
}
</code></pre>
<p>So, if anyone know give idea of that.</p>