Search code examples
androidandroid-studiolive-templates

Android studio creating live templates


I am creating a simple live template to show an AlertDialog in AS, snippet:

enter image description here

However, the Edit variables option is now inactive, even after I have selected the language type. Any help with this?

Previously I was able to do this


Solution

  • A variable in Live templates is specified between '$' characters. I noticed that, in your example, $className is specified instead of $className$. Just use the $className$(ends wit $) instead of $className and the "Edit Variables" button should become active.