Android Studio Tips & Tricks 3: Save & Format the Code

Hey,
Format the code is really important for readability code. So, here is how to save and format the code with a macro.
  1. Edit -> Macros -> Start Macro Recording
  2. Press “CTRL+ALT+L” then “CTRL+S”
  3. Enter a name for your macro
Record and save the macro

  1. Go to Settings -> Keymap -> Macros
  2. Find your macro and add a keyboard shortcut for it. Mine is ⌘S. You can do which keys you want.
and finally: Ta-daaa :) Now, you can use your macro to save and format the code easily :)
If you have any question, ask me :)
Have fun!

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...