invalidate is not working for Tablet 4.x in NonUi Thread environment
<p>in my app, when i try to overlay an image over another, it does not happens instantly, when i click on the screen only it happens. The thing that i want to say is that, this invalidate method works for mobiles but not for tablet (in my case). Here is my code:</p>

<pre><code>above.setOnClickListener(new OnClickListener() {

                                @Override
                                public void onClick(View v) 
                                {
                                     int positionn=0;

                                     Log.d("before", ""+io);

//io is an ArrayList containing objects of all the images on the screen                                 

if(io.size()==0)
                                     {

                                     }

                                     else if(io.size()==1)// when only one image on the screen
                                     {
                                         p.bringToFront();// to overlay the image. here p is an imageView
                                     }
                                     else if(io.size()==2)// // when only one image on the screen
                                     {
                                         for(int a=0;a&lt;io.size();a++)
                                         {

                                                if(p==io.get(a))
                                                {
                                                    positionn=a; // to get the position of image which has been clicked


                                                }
                                                else 
                                                {

                                                }

                                          }
                                         if(positionn==0)
                                         {
                                             p.bringToFront();
                                             io.get(positionn).postInvalidate(); // to refersh the screen ,,, and is not working for tablet
                                             io.get(positionn+1).postInvalidate();

                                             System.out .println("checking");
                                             Collections.swap(io,positionn,positionn+1);
                                         }
                                         else   // when the screen has more than 2 images
                                         {

                                         }



                                     }

                                     else
                                     {
                                         for(int a=0;a&lt;io.size();a++)
                                         {

                                                if(p==io.get(a))
                                                {
                                                    positionn=a; // to get the positionn

                                                }
                                                else 
                                                {

                                                }

                                          }

                                         Log.d("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;.",""+positionn+"----------"+(io.size()-1));
                                         if(positionn==io.size()-1)
                                         {
                                             // for last positionn,,,, since it do not required to be overlayed
                                         }

                                         else
                                         {

                                             try {
                                                    Collections.swap(io,positionn,positionn+1);
                                                } catch (Exception e) {

                                                    e.printStackTrace();
                                                }
                                             Log.d("after", ""+io);

                                         for (int a=0;a&lt;io.size();a++)
                                         {

        // for each and every position                                      
                                                    io.get(a).bringToFront();
                                                    io.get(a).invalidate();



                                        }

                                     }
                                     }



                                     for(int a=0;a&lt;io.size();a++)
                                     {
                                         io.get(a).invalidate();
                                     }


                                     counter.start();
                                }
                            });
</code></pre>
