Code example for Fragment

0
 
import com.newsblur.R; 
import com.newsblur.view.StateToggleButton; 
import com.newsblur.view.StateToggleButton.StateChangedListener; 
 
public class FeedIntelligenceSelectorFragment extends Fragment implements StateChangedListener {
	 
	public static final String FRAGMENT_TAG = "feedIntelligenceSelector";
	private StateToggleButton button;
	 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.fragment_intelligenceselector, null);
		button = (StateToggleButton) v.findViewById(R.id.fragment_intelligence_statebutton);
		button.setStateListener(this);
		return v;
	} 
 
	@Override 
	public void changedState(int state) {
		((StateChangedListener) getActivity()).changedState(state);