How do I open two or more projects at the same time in Android Studio? - android-studio

In Android Studio, I want to open another project, so I click File -> Open, but the original project has been closed.
What should I do to open the two projects at the same time?

To open multiple projects simultaneously in Android Studio,
go to Settings > Appearance & Behavior > System Settings,
in the Project Opening section,
choose Open project in new window.

Umh,I have solved my question.
First,I try to click the File->Find Action and search 'open new project'.Then I find a result and enter the settings window:Project opening.(So sad I have no reputation to post a picture)
Select the first check box.

Related

Android Studio isn't showing the xml editor [duplicate]

How can I enable the text/design Tab on the a src/main/res/layout folder on the activity_main.xml file that was created automatically during create new project? If i do right click and create xml file on the said folder, the design/text tab exist. Any suggestion? Thanks.
No Text/Design Tab on the Bottom Part of the Android Studio
Creating a new XML in the Res/Layout Folder, the design/text tab is now present.
Any help? this is super weird guys...
In Android Studio 3.6 use these three buttons (Code | Split | Design), on top right, to switch between views.
I had the same problem, restarting the IDE did make that tab appear again.
On Android Studio 3.6.1
Top Right corner under the main toolbar you have three different icons (Code, Split, Design).
View -> Tool windows -> Preview .
Output view:
use the three buttons (Code|Split|Design)on top right hand side to switch between views.
I also had this problem after upgrading to 1.5. None of the above suggestions worked for me. I noticed that the default relative layout xml has changed with a third xmlns line and an app behavior line. I opened an older project and copied the old relative layout header to replace the new. Instantly the preview function was restored.
You can also Move between Design / Text tabs in layout’s view with simple shortcut:
(Mac) : control + shift + ← / →
(Windows / Linux): alt + shift + ← / →
On the top right corner of the activity_main.xml file view, there are 3 icons representing "Code", "Split" and "Design". Click on the leftmost icon of the three ("Code") for the text tab.
In the android Studio window, at the left side there are two options available(Project and Resource Manager). Go to resource and there you will see an ADD Module option, click on that. After this you will see your text and design option will get enabled, you can go to your work area by Project Name->app ->src ->main->res ->layout.
Yes, Even I had the same problem. For the first time... I think It wont show, restarting the IDE did make that tab appear again.
I had this problem too, I deleted all the preference files, such as the AndroidStudioPreview folder & com.google.android.studio.plist, then restarted android studio, it worked.
You do not need to restart an IDE. All you need is to close an xml file that does not get a tab and reopen it within an editor. It is a little bug.
Navigate to activity_main.xml tab then Design and Text tab appears.
It doesn't appear in MainActivity.java tab.
You do not need to restart IDE.
If text/design tab is missing in new android studio, this can solve by two methods.
You have re-install android studio. And don't forget to delete android studio related all files from temp and local.
Or you can re-install SDK (software development kit) according to your device.

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.
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

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 project folders not showing

I am unable to see the folders that are physically existing, this is the case.
But in actual fact I have other folders as welll
So what can I do?
Above your the file directory view in Android Studio is a drop down which currently is most likely set to Android. Change it to Project and you should be able to see all your files.
I tried the all the approaches mentioned above but can't fix rather than fix it by a hardcore approach -
Step 1. Close your Android studio.
Step 2. Delete .gradle and .idea folder from your project directory.
Step 3. Open your project and you will see the files again.
go to View menu then click tool window then after click on project
view->toolwindow->project
it worked for me
for me doing the following works:
from menu go to: View--->tool windows ---> Project
then click the little gears icon (settings) you will see an option to change the empty middle packages. it looks like this:
disable "Hide Empty Middle Packages" under the Project View settings dropdown and then it should make everything show up.
If anyone ever does what I did maybe this will help:
Android Studio does not like it when module names begin with a number. I was learning from some tutorials and named the first module "1-name" and the next one "2-name". Setup was fine and it ran, but only the "Gradle" Scripts entry would show in the navigation window in "Android" mode.

How do I run multiple instances of Android Studio

How do I run multiple instances of Android Studio? A second instance is launched if you select "File\New Project", but "File\Open" and "File\Reopen" does not create a second instance.
Your Android Studio was set to open project in the same window. You can change that, so it asks whether to open new window while opening other project.
Do this:
Go to: File -> Settings -> Appearance & Behavior -> System Settings -> Project Opening.
Check [x] "Confirm window to open project in".
Now open the other (2nd) project with File -> Open... etc.
You will now be asked if you want to open a new window or replace what you already have. Select New Window.
Screenshots:
Older versions:
Go to Settings -> General -> Project opening.
Check 'Confirm window to open project in'.
Create or open different project
You will be asked if open a new window.
There was an update in Android studio so the new solution would be:
go to >file
go to >settings
go to >appearance and behavior
go to > system settings
now in system settings check the "confirm to open project in" option
On Mac is:
Android Studio
Preferences
Appearance & Behavior
System Settings -> Project Opening -> Confirm to open project in
When you open other project, you will be asked if you want to open a new window or replace what you already have.

Resources