kmansoor
kmansoor

Reputation: 4345

Android Studio: How to 'Refresh' after adding file?

I am trying to add a layout to an Android project:

Right clicked on res folder New | Directory. The directory was created however not shown under app/res. Maybe because empty dirs are hidden by default? Went to Windows explorer and added a file to the newly created directory (hidden in Android Studio). Back in the Studio, how can I 'refresh' the project structure to show the newly created directory and the file under it?

Essentially my question is, what is the alternative to Eclipse' Refresh menu option?

Upvotes: 44

Views: 81456

Answers (5)

Veikko Nyfors
Veikko Nyfors

Reputation: 1

Seems to be, in Android Studio Chipmunk 2021.2.1 at least:

  • 'File->Synchronize' refreshes project expolers Project view correctly
  • BUT it doesn't refresh the Android view. 'File->Invalidate caches and restart' refreshed this view for me. View is selectable from the drop down list up in the project explorer frame.

Upvotes: 0

MathewLamb
MathewLamb

Reputation: 131

In the case of device files - right click on the directory in question in the Device File Explorer and click on 'Synchronize'

Upvotes: 13

xTech
xTech

Reputation: 452

There is a view option right on top of the hierarchy folders (see attachment). Select "Packages"

Screenshot of project menu in Android Studio]

Upvotes: 5

Stephen H Sentoff
Stephen H Sentoff

Reputation: 511

If I find that Android Studio is out of synch with the file system I use File->Synchronize. Or equivalently, Ctrl+Alt+Y or the little circle with arrows menu button.

Upvotes: 38

Jorge Casariego
Jorge Casariego

Reputation: 22212

Mac

Cmd+fn+F9

Windows

Ctrl+F9

Upvotes: 1

Related Questions