I am working on an android project. I was just trying to split the view so that I could see two files side by side, when I lost the view. Basically, I grabbed apple.xml file and slide it to split the screen. This normally works. But, someone bumped into me and then when I looked, the file I just moved to split was gone. So I thought I closed it by accident (as the other files were still there). So I double clicked the apple.xml file in package explorer, but it did not open. So I decided to close all. And then when I double click on any of my files none of them opened: java or xml. A grey view shows as if it's where the file should be. But strange enough, the outline view for the file is shown.
How do I get the view back?
I find a workaround for the problem. I wouldn't call it a solution, so I am hoping someone who understands better can explain what happened and how to actually fix it.
workaround
click on the menu window
click on New Window
close the old window
Related
Android Studio: Text cursor disappears/gone after open some other class or pasting text in different classes.
Cursor is randomly disappear while coding in Android Studio. Currently using version 1.5.1
Some time cursor is only visible in one file either in java or xml
Right click is working but cursor is not visible in java/ or xml file so I am not able to type the code.
Observed scenario
The text cursor is not visible or the cursor is gone when I open a different file (e.g. ApplicationTest.java instead of activity_main.xml) the cursor appears again.
Expected scenario:
The text cursor should be located after the insertion point.
Action taken to solved
I used synchronize, restart Android Studio….. but not able to get solution.
I am using window 7 and I have cleared temp
R&D https://code.google.com/p/android/issues/detail?id=78384
I stuck to this problem so please help me. Appreciate, if anyone can help to troubleshoot.
command + O
type some words
esc
cursor appear, works for me
Just update the date time to proper date time.
Permanent workaround: 1
After studying a lot, I found that my system time was incorrect. (On my pc, it was because of windows time service error and not because of CMOS battery. while in some cases CMOS battery may cause this.).
Just update correct the date/time and the cursor will be visible.
If it is still not, close android studio, update correct and start android studio again.
Permanent workaround: 2
Reinstall windows and immediately install antivirus before installing any other software. (Mome malware can affect the working of time service in PC.). (Those who keep antivirus setup file/s on PC itself or USB device, they must check out whether the setup is clear in itself.).
Workaround: 3
On the left pane in android studio, strangely, all my classes were shown as singleton while they weren't.
I pressed multiple combinations multiple times of alter / shift / ctrl / mouse clicks to to check whether any key is stuck (which seldom happens).
I put Android Studio into power save mode: android studio -> file -> power save mode and tried to work again.
I corrected my system date (it was 2 days behind than current.)
Restarted the PC. The issue is resolved.
Disabled power save mode.
Temporary solution:
No need to close project or android studio.
Click on the scroll button on the right of the editing pane or on suggestions yellow lines somewhere else on the same vertical scroll bar line.
I have same problem too
but I solved with this trick..
Go to File-> Invalidate Caches / Restart
Now cursor should appear..
When the cursor disappeared, you can press Insert key on your keyboard, then the cursor will be appeared again.
Go back and check again.. You might find cursor there..
I am using 3.1.2 of AS on Mac. I faced the same problem after pasting multiple classes in AS. While cursor was gone I was able to make text selection. I checked StackOverflow for the solution and reached this question. After reading a couple of answers I went back to AS workspace and cursor was there...
In Android Studio 4.2 this issue still exists. I've deleted the settings file of the android studio folder by folder to find out which file is causing the error. In windows If you navigate to
C:\Users\{User}\AppData\Roaming\Google\AndroidStudio4.2\options
you will see an other.xml file. You can delete this file. This might fix the issue (at least it fixes it in my case). You can also comment out or delete this line in the other.xml file to fix the issue
<property name="Source Code Editor With PreviewLayout" value="Preview only" />
Just follow this answer for faster solution.
Original Post
In my case the cursor was disappearing when I opened a file/class from recent files dialog. When I deleted a file from the list and opened it again (for example: ctrl + n -> go to class) the cursor was there but then opened it again and the cursor was gone.
The solution for me was to restore default settings from Android studio (invalidate caches/restart didn't help me).
Edit October 2021
It happened again (AS 2020.3.1 running on Ubuntu 20.04)
After restoring to default settings AS makes a backup of your settings files to ~/.config/Google/AndroidStudio2020.3-backup.
I just deleted new files in ~/.config/Google/AndroidStudio2020.3 and copy there the old files and it works! (I didn't proceed through the initial setup of AS, but open my project, then exited it, replaced old settings files and then run again.)
Close the android studio, not just the project instead the IDE. then open it again, wait till it build and then cursor appears.
You might have column select on by accident, turn it off with
ALT + SHIFT + I
this happens because some other text editor is open on PC........close that text editor/other instance of android studio and this will be solved....
Could somebody tell me if it is possibile to open two instances of the same project in Intellj IDEA or can I for example have two windows with opened different project files with attached project explorer.
I asking for that because I have two monitors and it will be more efficient to navigate on each windows separately.
For now I must drag tab from root window and drop to another window which it is annoying and unhandy.
This is not possible. IntelliJ IDEA has a one project one window paradigm.
Some suggestions, in order of best to worst, that may help:
The navigation bar (Alt+Home or ⌥⇱ {Option Home}) can be used in place of the project tool window. You can use it either in pop-up mode or anchored mode (View > Navigation Bar). When a file is opened via the navigation bar, it opens in the window that has focus. The nav bar is ultimately a horizontal project window. Check the help documents for how to easily navigate through the nav bar. Once you get use to it, you may find you never use the project tool window again.
Have you tried floating the project window and placing it on the edge of one of the monitors so it sites between the two editor windows? While you would still need to drag file to the second editor window, it might prove easier.
You could create a second project with the all the same modules as the first project (just being sure to save the second project's .idea configuration directory in a different location). But this would require keeping two project configurations in sync, and you would need to make sure the "synchronize files on frame activation" setting is on. In the end, I think that is far more hassle then it is worth.
Hope that helps.
(FYI, I may be new to StackOverflow, but I'm a ten year passionate and evangelical IntelliJ IDEA user.)
I am very new to android programming, migrating over from iOS and I am having a hard time.
So, I have set up a new application in Eclipse IDE with a fixed tab and swipe navigation. So it appears to have created a ActionBar. However, I need to change the content of each page rather than it just telling me which tab I clicked.
I have been searching for this for about, 30-45 mins now, and I cannot find anything which makes any sense!
How can I attach a new XML file to a view?
I think the code you are looking for is:
setContentView(R.layout.your_xml_file)
Make sure your xml file is in your res/layout folder in your project
As for your button listener, check this answer.
I wonder if it is possible, to hide some packages (or directories) from the netbeans package view window.
Currently, I am working on a project, which has many projects, but I only know some of them.
I like the list view, so just collapsing it to a tree is not what I'm searching for.
Thanks in advance!
You can't hide only some packages of some project, you've got opened. You can only show/hide whole projects. If you don't want to have so many projects opened in your current perspective, just click with you RMB to that project and click Close. Then press select it with LMB and press Delete. Just be sure NOT to check Delete files also on local disc, otherwise, you permanently lost your files!!!
I am learning Java using Eclipse - started a project with javax.swing and could view a design page with my page layouts shown and various palets for components etc. Now this design page seems to have vanished and I cant discover any option to recover it. I hope someone can get me back on track.
Have you tried Right-click on class (for example MySwingPanel.java) in package editor Open With->WindowBuilder Editor?
The last time you selected something in Open With - this is the editor to open that file on double click.
Have you tried changing the Perspective? Click the arrows next to the DDMS tab in the upper right hand corner of Eclipse and select the 'Java' Perspective.