All Downloads are FREE. Search and download functionalities are using the official Maven repository.

roboguice.fragment.provided.RoboPreferenceFragment Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package roboguice.fragment.provided;

import roboguice.RoboGuice;

import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.view.View;

/**
 * Provides an injected {@link PreferenceFragment} based on the native HONEY_COMB+ fragments.
 * A RoboPreferenceFragment will see all its members and views injected after {@link #onViewCreated(View, Bundle)}. 
 * @author SNI
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB) 
public abstract class RoboPreferenceFragment extends PreferenceFragment {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        RoboGuice.getInjector(getActivity()).injectMembersWithoutViews(this);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        RoboGuice.getInjector(getActivity()).injectViewMembers(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy