Skip to content

Instantly share code, notes, and snippets.

View wangkunlin's full-sized avatar
:octocat:
I may be slow to respond.

王坤林 wangkunlin

:octocat:
I may be slow to respond.
  • Mtime
  • 北京市朝阳区
View GitHub Profile
@keyboardr
keyboardr / HeadlessFragment.java
Last active December 31, 2021 01:05
A file template for creating a headless Fragment. The attach() methods add the fragment to the parent if it doesn't already exist and returns the attached fragment. The methods ensure that the parent implements the parent interface. If needed, parameters may be added to the attach() methods to supply fragment arguments.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
#parse("File Header.java")
public class ${NAME} extends Fragment {
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName();