30

Coming from Eclipse I now use Android Studio for development. In Eclipse it was always clear which files were not saved, but in Android studio I see no distinction between the open files that have been saved, and the ones that haven't. Plus, if there are any files that have not been saved when you build and run, Eclipse asks me whether I want to save those files before running. Both these functions make developing a lot easier.

So does anybody know:

  1. a way to distinguish between saved files and files that haven't been saved in Android Studio?
  2. a way to make Android Studio ask me if I want to save files before it builds and runs?
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
kramer65
  • 50,427
  • 120
  • 308
  • 488

3 Answers3

73

The link plastiv provided explains that files are auto saved. It does not (as far as I can see) answer your first question about distinguishing saved and unsaved file. To do that, you can go to Settings > [IDE Settings] > Editor > Editor Tabs and select the option "Mark modified tabs with asterisk".

UPDATE

In IDEA v14 and later, this setting is located on the Settings > Editor > General > Editor Tabs pane

Javaru
  • 30,412
  • 11
  • 93
  • 70
  • 2
    Also, modified files has different color at project view (alt+1), if you are using source control. – Sergii Pechenizkyi Nov 26 '13 at 09:59
  • 1
    This is nice, but why doesn't the asterisk always go away on its own when this option is turned on? – Manius Jan 15 '15 at 00:58
  • @Crusader - The asterisk should go away when the file is saved either via Ctrl+S (Save All) or via the auto save. If it is not, then there is a bug somewhere. I recommend you file a bug report. Be sure to include your OS and IDEA version. Given that this is a 10 to 13 year old feature that's worked as expect all this time, any problems with it would likely be platform specific. – Javaru Jan 15 '15 at 14:30
  • 12
    This should be the accepted answer. It actually addresses the question rather than suggest that the question is invalid. – SMBiggs Jun 07 '15 at 14:17
  • It should be considered that Settings is in File menu: File > Settings > Editor > General > Editor Tabs pane > Mark modified tabs with asterisk – Mohsen Abasi May 14 '16 at 05:11
  • @Mohsen Abasi - Settings is not under file on the Mac. So I kept it generic to just "settings". – Javaru May 15 '16 at 12:14
10

Check IntelliJ IDEA Q&A for Eclipse Users: http://www.jetbrains.com/idea/documentation/migration_faq.html

Q: How do I make sure all my files are saved?

A: Don't you worry. They are all saved automatically.

Community
  • 1
  • 1
Sergii Pechenizkyi
  • 22,227
  • 7
  • 60
  • 71
  • 5
    Yeah...eventually. I just lost 20 minutes scratching my head trying to figure out why my Maven build wasn't working correctly. It was because I had trusted auto-save to save, but it hadn't. Usually the auto-save is pretty prompt, but not always, I guess. The other answer about turning on the asterisk display on the editor tab is a real treat for me, and I'm going to use that from now on! – Sharky Apr 04 '16 at 01:46
  • 8
    This doesn't address the issue of how to tell if your files are saved and therefore doesn't answer the question asked. – sf_jeff Jul 24 '16 at 02:09
10

Mark Changed But Unsaved File

File > Settings > Editor > General > Editor Tabs > then check Mark modified tabs with asterisk > OK

Screenshot- Mark Changed But Unsaved File


Now, you may also want to do this-

Save Only One File with Ctrl+S

File > Settings > Keymap > search with save document > right click Save Document > Add Keyboard Shortcut > press Ctrl+S> OK > Remove > OK

Screenshot- Save One File with Ctrl+S

Minhas Kamal
  • 20,752
  • 7
  • 62
  • 64