This file contains 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
// Add menu | |
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createMenu('Android') | |
.addItem('Export', 'exportTranslations') | |
.addToUi(); | |
} | |
function exportTranslations() { | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); |
This file contains 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
public class MyApplication implements LifecycleObserver { | |
@Override | |
public void onCreate() { | |
ProcessLifecycleOwner.get().getLifecycle().addObserver(this); | |
} | |
@OnLifecycleEvent(Lifecycle.Event.ON_START) | |
public void onStart() { | |
Log.d("App in foreground"); |
This file contains 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
public final class AppTransitionStatus implements Application.ActivityLifecycleCallbacks { | |
private static final long MAX_BACKGROUND_TIME = 2000; | |
private Timer timer; | |
private TimerTask task; | |
private boolean isBackground = true; | |
private final Transition transition; | |
public AppTransitionStatus(@NonNull Transition transition) { |