Q:

Can Android studio go to previous opened file after i Ctrl+F4 to close current?

It's an interface problem using Android Studio.
Like any other multiple tab application, using Ctrl+F4 to close the current window/ file gets you back to the previous one.
For example, if i edit MainActivity.java and switch to activity_main.xml I'm used to the behavior that when I click Ctrl+F4 to close the activity_main.xml it goes back to the previous file which is MainActivity.java but for some reason (even after I changed the keymap to Visual Studio) it goes back to a random file.
Does anyone know how to change this behavior?
Before you answer
I'm not looking for shortcut key to reopen last opened window.
The file is still opened, i'm just looking for the regular behavior that the focus will go to the last file automatically after closing file.

A:

File > Settings > Editor > General > Editor Tabs > When closing active editor > Activate most recently opened tab

