心得:
從Eclipse轉到Android Studio實在太累了,一堆功能又不太一樣,一直卡在Debug要如在AS上操作比較順利,常常知道Eclipse的功能,但轉到AS不知道要去哪裡設定?再加上英文關鍵字也不知道要如何下?
比如說:
URL url = new URL();
使用eclipse時(Shift+Ctrl+O)會自動說明需要加上try ... catch ...exception 或 throws ...exception,並自動產生出來。
但在AS只會和你說 Unhandled exception: ...之類的,但是要如何解決,需要自己去查api要如何使用,沒有直接提示。
其實是有的,只是這個功能被關閉哩 (= =|||)
StackOverflower類似的問題:
Is there any way of auto importing (like in Eclipse Shift+Ctrl+O) in Android Studio?
I have found only Ctrl+Alt+O which ask for each thing, and I have to press Alt+Enter to accept it.
No way to do it faster?
For Windows/Linux, you can go to
File
-> Settings
-> Editor
-> General
-> Auto Import
-> Java
and make the following changes:- change
Insert imports on paste
value toAll
- mark
Add unambigious imports on the fly
option as checked
On a Mac, do the same thing in
Android Studio
-> Preferences
沒有留言:
張貼留言