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

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.

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

UPDATE: Consider the other answer first.
Okay, I've understood what you're trying to achieve. You want IDE to track the context in real-time. I think that is not present currently. I would first ask in the JetBrains IDEA Community Forum and then go ahead and open a Feature-request on the IntelliJ IDEA issue tracker. They actually respond quite fast.
Good Luck!
P.S. Android Studio, in fact, uses IntelliJ IDEA underneath

Related

Android studio only show blank files

I closed the emulator tab and all of a sudden no files can be viewed, except the first row of one .arb language file.
It doesn't matter what kind of file it is, it's not showing up and I can't write anything in the text window.
I quit android studio and restarted the computer but it still the same.
How can I fix this?
Close the project, then open it via file-> open... and select your root folder.
After that it works again!

Recovering files deleted by Android studio?

I'm working on an app at the moment, and one of the final steps was to get it built and signed in Android studio.
Unfortunately I was having some problems, and one of the recommended solutions was to remove the project and start again, however when I did this it took all of my files with it, and they're not in the trash (OSX) either.
Is there anyway to recover these files, or are they lost forever? :(
In my case I was looking for the file named 'landing_page222.java' which I deleted one day back.
Following Steps can help you to find your previously deleted files in Android Studio.
Step 1: Right Click on the folder where you deleted the file
Step 2: Find option for Local History and Click Show History.
Step 3: Find your File from Given List.
Hopefully it will be available in Instance
Step 4: Copy the code back as per need.
You can try:
looking for those files in the file system (perhaps they are still in your Android Studio projects folder)
looking in your OS's temp folder
using Android Studio's history feature (right-click on the Project tab > Local History > Show history)
Click whereever you want in the left frame (for example "drawable" file is ok) and then press CTRL+z. You are going to see "Undo delete popup" window.
And as you understand, when you press CTRL+z in Android Studio, which (XML or Java) file is active, you will undo the action on that tab. So, if you click any file on the left side and press the CTRL+z combination, you will undo the action at the file structure.
Go to View > Recent Changes > Click on the file you want to recover > Click "Revert"
Im late but this works. Go to the folder where u want to recover. right-click, local history. select ones you deleted and click revert. :)

Android Studio duplicate Version Control

I am creating a new project with Blank Activity in Android Studio.
Then VCS > Enable Version Control Integration > Git > OK.
After that I am closing the project and immediately I am opening it.
I am opening Setting > Version Control and it turns out that settings duplicate.
If I close and open the project again, one more backup line appears. And the quantity of such duplicating lines increases with every start.
Please, could you explain me, if it is normal or I do something wrong? Thanks a lot for you response.
http://hsto.org/files/806/992/9a6/8069929a60724887b55805b4fd6868e9.png

Copy-paste is not working in Android Studio on Mac

I am facing a weird issue with Mac version of Android Studio (i.e., I am not able to copy (⌘ + C) and paste (⌘ + V) any text). I have no idea why it is behaving strange like this. My question may be silly, but I have been facing this issue since I started working from Windows to Mac. Any solutions and alternatives would be much helpful for me. I am completely stuck with this issue for the past two days.
There are several reasons why you could be experiencing this
You are using ClipMenu and Android studio doesn't like it
Your keybinding is messed up.
To solve keybinding issue press File -> Settings and check what the keybindings are, you have maybe changed it or imported settings from somebody else. See the image as a reference.
Note: the filter of copy, you need to do this for paste too.
To fix the issue with ClipMenu.
Right click on "Application/IntelliJ IDEA 14.app"
choose "Show Package Contents"
edit bin/idea.properties
add this property ide.mac.useNativeClipboard=True
restart IntelliJ IDEA.
There is a YouTrack issue with further information
this worked for me
go to file menu and click on invalidate Caches/Restart ,after this confirm the dialog open .
Go to File-> Setting->Editor(Under IDE Settings)->Change value of maximum number of contents to keep in clipboard to 1(Under Limits section)
I have this issue due to PopClip I have to disable it to get the keyboard shortcuts working.
Check that your keymaps aren't messed up. Go to Android Studio > Preferences > Keymap > Main Menu > Edit. If copy and paste are set correctly there, then it must be something else in your system that's stopping it
I got this bug with my ClipMenu (on Mac) while set useNativeClipboard=true.
I solved the problem by using ClipMenu to paste file into Android Studio (show menu of ClipMenu, then select item)
In my case, the Ctrl c is occupied by other programs(my case is "Oulu Dictionary" program).
Try to check if other programs have global shortcut keys.
disable the plugin Ideavm if installed under settings>plugins>installed.

DataSet designer opens as Xml editor

I had a power outage and while I am certain I saved my work recently something did go wrong. The xsd file I was editing in the Designer mode no longer opens in designer, when I double click it, I get the xml of it. Strangely enough any other xsd I open opens perfectly as design-view. Resetting VS settings doesn't seem to help, can it be something in my project?
goto your Solutions Explorer.
right click the dataset you are trying to open up.
Click "Open With"
you should get a dialog box come up, select "Dataset Editor" and press ok.
From here on you should be all set again.
Steve
The fastest way I could think of that would fix this problem, is to exclude that xsd(and its dependants) from the project, then in explorer delete all the files that have the same name as the xsd but not the xsd itself. Then add the xsd file back to project in Visual Studio and it will work fine again. The only downside is that it rearranges the visual aspect of the xsd :/
Hope it helps someone.
Look in the Error window and see if you have any errors, warnings, or messages about the XML. Also look in the Output window to see if there are any complaints.
SOLVED!
I edit the .cs file under of .xsd file. Edit this file and erase all. that's it, works for me.

Resources