From 2f3c16659b4ee5de54fe297e8e797d8631aab7d5 Mon Sep 17 00:00:00 2001
From: Rich Slogar
Live templates allow you to enter code snippets for fast insertion and completion of small chunks +of code. To insert a live template, type the template abbreviations and press the +Tab key. Android Studio inserts the code snippet associated with the template into +your code.
+ +For example, entering the newInstance abbreviation followed by the
+Tab key inserts the code for a new fragment instance with argument placeholders.
+public static $fragment$ newInstance($args$) {
+ $nullChecks$
+ Bundle args = new Bundle();
+ $addArgs$
+ $fragment$ fragment = new $fragment$();
+ fragment.setArguments(args);
+ return fragment;
+}
+
+
+Similarly, the fbc abbreviation inserts a findViewById call along
+with cast and resource id syntax.
+() findViewById(R.id.); ++ +
Use the File > Settings > Editor > Live Templates menu option to +display the full list of supported live templates and customize the inserted code.
+ +