Why won't my application close with a time handler?
<p>I´m making a game in which when you touch any place of the image, a pop up apears for 1000 milliseconds. but this was the problem If I closed the activity it would crash, so I added a time handler to close the activity. But that generated another problem. It seems the new activity is being called but te handler does not close the activity.</p>

<p>I attach the activity for lvl1 where the problem appears. ( I use a background invisible image with different colors to set the touchable areas. For example, where the background color is white, it returns the popup. When it´s yellow, it calls another activity and so on. ( The colours thing doesn´t seem to work on motorola Dunno why. ))</p>

<p>This is the handler of the popup</p>

<pre><code>else if (ct.closeMatch (Color.WHITE, touchColor, tolerance)) // con esto evito poing &amp; click muy seguidos
{          
  Random r = new Random();
  int txt= r.nextInt(6-0) + 0;
  if(txt==0){ variables.pointtxt = "Nothing interesting"; }
  else if (txt==1){ variables.pointtxt = "There´s nothing there"; }  
  else if (txt==2){ variables.pointtxt = "I can´t do nothing with that"; }  
  else if (txt==3){ variables.pointtxt = "Wait... nop nothing"; }   
  else if (txt==4){ variables.pointtxt = "Nothing"; }   
  else if (txt==5){ variables.pointtxt = "More nothing"; }

 LayoutInflater layoutInflater = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

 View popupView = layoutInflater.inflate(R.layout.popup, null);  
 final PopupWindow popupWindow = new PopupWindow(
    popupView, LayoutParams.FILL_PARENT,  LayoutParams.WRAP_CONTENT);
 TextView text = (TextView) popupView.findViewById(R.id.popuptxt);
 text.setText(variables.pointtxt);

 popupWindow.showAtLocation(popupView, Gravity.CENTER, 0, 250);

 new Handler().postDelayed(new Runnable() {
      public void run() {    
        if (popupWindow.isShowing()== true)
          popupWindow.dismiss();
      }
    }, 1100
  );           
}

handledHere = true; 
break;

default:
  handledHere = false;
} // end switch
</code></pre>

<p>And this is how I close the activity and call the new activity</p>

<pre><code>else if (ct.closeMatch (Color.YELLOW, touchColor, tolerance)) {
  Intent game = new Intent(lvl1.this, lvl1_0.class); startActivity(game);
  Handler mHandler1 = new Handler();
  {
    Runnable mLaunchTask3 = null;
    mHandler1.postDelayed(mLaunchTask3,1100);
  }

  //will launch the activity
  Runnable mLaunchTask3 = new Runnable() {
    public void run() {
      lvl1.this.finish();
    }
  };
}
</code></pre>
