Back to project page Teracast-Android.
The source code is released under:
Apache License
If you think the Android project Teracast-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.davidtpate.teracast.ui.base; /* w ww . j av a2 s . c o m*/ import android.app.Fragment; import android.os.Bundle; import android.view.View; import butterknife.ButterKnife; /** * Base class for all non-specialized Fragments. */ public abstract class BaseFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); } public void showProgressBar() { getActivity().setProgressBarIndeterminateVisibility(true); } public void hideProgressBar() { getActivity().setProgressBarIndeterminateVisibility(false); } @Override public void onDestroyView() { ButterKnife.reset(this); super.onDestroyView(); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ButterKnife.inject(this, view); } /** * Is this fragment still part of an activity and usable from the UI-thread? * * @return true if usable on the UI-thread, false otherwise */ protected boolean isUsable() { return getActivity() != null; } }