Created
May 6, 2016 16:34
-
-
Save amitshekhariitbhu/4ae420fc35c60f503f0a863d882b98b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Write this in onBackPress of your MainActivity | |
public class MainActivity extends AppCompatActivity{ | |
@Override | |
public void onBackPressed() { | |
super.onBackPressed(); | |
// This is important : Hack to open a dummy activity for 200-500ms (cannot be noticed by user as it is for 500ms | |
// and transparent floating activity and auto finishes) | |
startActivity(new Intent(this, DummyActivity.class)); | |
finish(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment