Skip to content

Instantly share code, notes, and snippets.

@mrmike
Created April 18, 2013 14:01
Show Gist options
  • Select an option

  • Save mrmike/5412923 to your computer and use it in GitHub Desktop.

Select an option

Save mrmike/5412923 to your computer and use it in GitHub Desktop.
Template for creating basic fragment's methods
// Add this template in Preferences > Java > Editor > Templates > New
// I stored this snippet with newFragment name, but you can use any name you want
public static Fragment newInstance() {
return new ${fragment};
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.${layout}, container, false);
return view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment