How to generate a try catch code block automatic in Android Studio by shortcut?

Highlight the code you want to surround with try/catch

For Windows it is:

Press Ctrl + Alt + t

For Mac it is:

Press cmd + Alt + t

Select the item you want (#7 for try / catch)

There is no need to “type” try first however, highlighting your code works better.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)