Application registerActivityLifecycleCallbacks - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Application registerActivityLifecycleCallbacks method.

This code example shows how to use the following methods:registerActivityLifecycleCallbacks
        MainLifecycleDispatcher.get().registerActivityLifecycleCallbacks(callback);
    } 
 
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    private static void postIcsRegisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
        application.registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacksWrapper(callback));
    } 
 
 
    /* 
     * Unregister. 
     */ 
 
    /** 
     * Unregisters a previously registered callback. 
     *  
     * @param application The application with which to unregister the callback. 
     * @param callback The callback to unregister. 
     */ 
    public void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
6
CodeRank
This code example shows how to use the following methods:registerActivityLifecycleCallbacks
 
        //Injectionを行うオブジェクト 
        Injector injector = Guice.createInjector(mockModule);
 
        //モックオブジェクトがActivityにInjectionされるようにコールバックを登録する 
        Application app = new Application();
        app.registerActivityLifecycleCallbacks(new InjectionActivityLifecycleCallbacks(injector));
        setApplication(app);
         
        //-- When 
 
        //Activityを起動する 
        startActivity(mStartIntent, null, null);
 
        //-- Then 
 
        //川崎の天気の表示が晴れになっていること 
        TextView weatherKawasaki = (TextView) getActivity().findViewById(R.id.weather_kawasaki);
        assertEquals("川崎の天気は晴れ", weatherKawasaki.getText(), "晴れ");
 
6
CodeRank
This code example shows how to use the following methods:registerActivityLifecycleCallbacks, unregisterActivityLifecycleCallbacks
        this.currentApp = currentApp;
    } 
 
    public void enable() { 
        if (isPasswordLocked()) { 
            currentApp.unregisterActivityLifecycleCallbacks(this);
            currentApp.registerActivityLifecycleCallbacks(this);
        } 
    } 
 
    public void disable() { 
        currentApp.unregisterActivityLifecycleCallbacks(this);
    } 
 
    public void forcePasswordLock() { 
        lostFocusDate = null;
    } 
 
    public boolean verifyPassword(String password) {
        String storedPassword = settings.getString(APP_LOCK_PASSWORD_PREF_KEY,
5
CodeRank
This code example shows how to use the following methods:registerActivityLifecycleCallbacks, unregisterActivityLifecycleCallbacks
    public void enable(){ 
    	if (android.os.Build.VERSION.SDK_INT < 14)
    		return; 
    	   
        if( isPasswordLocked() ) { 
            currentApp.unregisterActivityLifecycleCallbacks(this);
            currentApp.registerActivityLifecycleCallbacks(this);
        } 
    } 
     
    public void disable( ){ 
    	if (android.os.Build.VERSION.SDK_INT < 14)
    		return; 
    	 
        currentApp.unregisterActivityLifecycleCallbacks(this);
    } 
     
    public void forcePasswordLock(){ 
        lostFocusDate = null;
    } 
5
CodeRank
This code example shows how to use the following methods:registerActivityLifecycleCallbacks
        MainLifecycleDispatcher.get().registerActivityLifecycleCallbacks(callback);
    } 
 
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    private static void postIcsRegisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
        application.registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacksWrapper(callback));
    } 
 
 
    /* 
     * Unregister. 
     */ 
 
    /** 
     * Unregisters a previously registered callback. 
     *  
     * @param application The application with which to unregister the callback. 
     * @param callback The callback to unregister. 
     */ 
    public void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
5
CodeRank
This code example shows how to use the following methods:registerActivityLifecycleCallbacks
     * @param callback The callback to register 
     */ 
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    private static void registerFrameworkActivityLifecycleCallbacks(@Nonnull Application application,
                                                                    @Nonnull CompatibleActivityLifecycleCallbacks callback) {
        application.registerActivityLifecycleCallbacks(new FrameworkActivityLifecycleCallbacks(callback));
    } 
 
 
/* Callback unregistration */ 
    /** 
     * <p>Unregisters the callback from the given {@link Application}'s {@link android.app.Activity} lifecycles.</p> 
     * 
     * @param application The application from which to unregister the callback 
     * @param callback The callback to unregister 
     */ 
    public void unregisterActivityLifecycleCallbacks(@Nonnull Application application,
                                                     @Nonnull CompatibleActivityLifecycleCallbacks callback) {
        if (!GateKeeper.hasIcs()) 
            unregisterCompatibleActivityLifecycleCallbacks(callback);
4
CodeRank

Related Application registerActivityLifecycleCallbacks Questions & Answers:

registerActivityLifecycleCallbacks Method Overview
See Code Examples for other Android Application Methods: