androidmobclix

Non destroyable full screen mobclix ads


Id like my full screen mobclix ads to be non destroyable for 2 seconds. Right now users can press the back button on the android phone before the ad even shows up. How can I accomplish this?


Solution

  • All you need to do is intercept the back button press which you can do by overloading:

    onBackPressed()
    

    On older devices this won't quite work and you'll need to do something like:

    public boolean onKeyDown(int keyCode, KeyEvent event) 
    {
      if (keyCode == KeyEvent.KEYCODE_BACK) {
        //Do something here
        return true;
      }
    return super.onKeyDown(keyCode, event);
    }