Back to project page android-sensor-example.
The source code is released under:
Apache License
If you think the Android project android-sensor-example 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 be.hcpl.android.sensors.core; /*w w w. j a va2 s . co m*/ import android.support.v4.app.Fragment; import be.hcpl.android.sensors.MainActivity; /** * A base class for all fragments that will show up in the navigation bar. These all need a * properly implemented toString() implementation since we use a default listAdapter implementation */ public class BaseFragment extends Fragment { @Override public String toString() { return this.getClass().getSimpleName(); } /** * this isn't really needed but makes it easier to get the parent activity fragment for * switching content without having to cast and check for types and so. * * @return the parent activity as a MainActivity instance */ protected MainActivity getParentActivity(){ return (MainActivity)getActivity(); } }