Back to project page android-tools.
The source code is released under:
MIT License
If you think the Android project android-tools 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 net.comfreeze.lib.ui.fragment; // w w w. j a v a2s. c o m import android.support.v4.app.Fragment; public class CFZFragmentBase<T> extends Fragment { private static final String TAG = CFZFragmentBase.class.getSimpleName(); public static <T extends CFZFragmentBase> CFZFragmentBase instance(CFZFragmentBase<?> targetClass) { return (T) targetClass.instance(); } public T instance() { try { return (T) this.getClass().newInstance(); } catch (java.lang.InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; } }