Skip to content

Instantly share code, notes, and snippets.

@mstoic
mstoic / disable_animation_activity.java
Created September 10, 2018 08:18
Completely disable all opening application for an activity.
// Source: https://stackoverflow.com/a/11079475
// Add below code to styles.xml
<style name="noAnimTheme" parent="AppTheme.NoActionBar">
<item name="android:windowAnimationStyle">@null</item>
</style>
// Set below theme for Activity in Manifest
@mstoic
mstoic / clear_top_stack.java
Last active September 10, 2018 07:28
A flag to close all previous activities of your app
// Close all previous activities
// https://stackoverflow.com/questions/6330260/finish-all-previous-activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
// 10-09-18 - Not working in App Lock.
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);