How to move to previous caret position in Android Studio

How to move to previous caret position in Android Studio

Filibert Nosizwe Author: Filibert Nosizwe Date: 2022-08-16
How to move to previous caret position in Android Studio

All you need to know about How to move to previous caret position in Android Studio , in addintion to SD Card (created in AVD) shows as "removed" in Emulator for Android Studio , intellij idea - How to effectively remove all breakpoints in Android Studio , How to move Android Studio's menu bar , git - How to revert project back to a previous commit in android studio

  1. How to move to previous caret position in Android Studio
  2. Question:

    How can one move to previous caret position(s) in android studio? It was possible in Eclipse.


    Solution 1:

    Use Ctrl + Alt + Left and Ctrl + Alt + Right

    For Mac, use Command + Option + Left and Command + Option + Right

    If these don't work for you, it is possible that these keys are assigned for some of the functions of your OS/video drivers, you can either disable the shortcuts that are using these keys from operating system settings/video driver settings or change shortcuts from Android Studio itself by going to:

    File > Settings > Keymap > Main menu > Navigate > Back/Forward
    

    Move to previous caret position Android Studio

    Mac users can find this dialog by going to Android Studio's: App Menu -> Preferences

    Solution 2:

    It's Alt + Ctrl + Right/Left arrow and mouse buttons 4 and 5 (if your mouse has those). You can change these shortcuts under:

    File > Settings > Keymap > Main menu > Navigate > Back/Forward.

    Solution 3:

    • Another option : move to the last edit location: CTRL + SHIFT + BACKSPACE

    • Move to the last cursor position: CTRL + ALT + left Arrow

  3. SD Card (created in AVD) shows as "removed" in Emulator for Android Studio
  4. Question:

    I created a virtual device with an SD card (AVD Manager->Edit the device->Advanced Settings) but my app still shows it as not there:

    //This prints: External: removed
    Log.d(TAG, "External: " + Environment.getExternalStorageState() );
    

    How do I get external storage to work?

    I'm using:

    Android Studio 0.8.14 Device: Nexus 5, 4.4 KitKat, CPU: x86


    Solution 1:

    In addition to creating an image for the SD card in the AVD Manager, you also need to manully edit the config file (this is a bug).

    Find the emulator's configuration in your home directory:

    #Located in:
    ~/.android/avd/<The_Device_Name>/config.ini
    

    For example, on the Nexus 5 (created by Android Studio), it was:

    ~/.android/avd/Nexus5.avd/config.ini
    

    Change the below setting to be:

    hw.sdCard=yes
    

  5. intellij idea - How to effectively remove all breakpoints in Android Studio
  6. Question:

    I tried various steps to remove breakpoints from Android Studio . One of them listed in question BreakPoint link

    I followed this but , still there are some green colored with red circle remaining , what are those as seen in image below and how to remove those effectively.

    Image after removing breakpoint


    Solution 1:

    Remove all breakpoints in android studio

    Click on red icon which is below to stop debug. you will see a window there you can remove all breakpoints.

    Solution 2:

    Solution 3:

    First, click on debug tab and you see a screen like this:-

    enter image description here

    Now you will see a window like this:-

    enter image description here

    From this screen you can remove breakpoints by clicking (-) button. To remove all break point first select Java Line break Point option and then click (-).

  7. How to move Android Studio's menu bar
  8. Question:

    Sorry, I know this is a stupid question, but I don't know what I should to do. I already searching for solution over the internet no found nothing on it.

    This is what my Android Studio looks like, I don't know what I did before:

    my android studio

    I want my Android Studio to look like this:

    my friend AS

    Please help me.


    Solution 1:

    Go to View menu and enable Toolbar

    Enable Android studio's toolbar

    Solution 2:

    Edit: You get your friends layout by clicking on "View" and then check "Toolbar". What i wrote below this paragraph is all nonsense, but I leave it there anyway, maybe it is still of help.

    I believe your friend has the default view. You can try resetting your view by going to "Window" and "Restore Default Layout". If that does not work try "File" and "Settings", and in there "Appearance and Behavior" and "Menus and Toolbars", and in the bottom right you can select "Restore Default".

    But careful, it might reset something that you changed somewhere else as well, so be sure it won't be a problem for you.

    Solution 3:

    Go to View > Disable all Toolbars,Status Bars,etc.

    Again, go to View > Enable Toolbar,Tool Buttons and Status Bar!

    Back to Original...Enjoy!

  9. git - How to revert project back to a previous commit in android studio
  10. Question:

    I am working on a project in android studio and would like to revert to a previous push. I attempted
    VCS => Git => Reset Head (Hard)
    but my project in Android Studio is unchanged, likely because I'm doing something wrong. I would like to revert the project in Android Studio to a specific earlier commit that I've pushed and I see on github. I do not care about any changes that I have made since the earlier push.
    Additionally, I would like this to be done through the GUI within Android Studio if possible.


    Solution 1:

    Android Studio Instructions: if you want to do this in Android Studio, press alt + 9 (or Command + 9 on Mac) to open the Version Control panel. Switch to the Log tab and right click on a previous commit. Select Checkout Revision.


    Command line instructions: Open the command line tool you are using. Go to the Android app's Git directory (using cd). Execute git log and find the previous commit you want to revert to.

    commit 7c247be6d8975dc88f6cc2631c154786a1f3b79e
    Author: John Doe <john@doe.ca>
    Date:   Fri Jun 11 22:37:35 2015 -0400
    
        Some helpful commit message should be here.
    

    If that is the commit you want to revert to, then execute git checkout 7c247b.

    Solution 2:

    Open the Version Control Panel using alt + 9 and click on Log. This should show a list of commits. Right click on the commit you want to revert to and select Reset Current Branch to Here. This should bring up a list of options to keep or discard changes when reverting. Select Hard to discard any current changes and click Reset.

    Solution 3:

    The icon surrounded by red rectangle in image will do the trick