Hopefully the title makes sense; As you can see from the image below, when I type Channel
Android Studio auto-completes WifiP2pManager.Channel
inline instead of putting import android.net.wifi.p2p.WifiP2pManager.Channel;
at the top of the class.
I suspect it's doing it this way because I've already imported WifiP2pManager
.
Is there a way to change this so it adds the import at the top of the class instead?
2 Answers
You can use android.net.wifi.p2p.WifiP2pManager.* instead of android.net.wifi.p2p.WifiP2pManager .It will be loaded all methods in this wifip2Manager.
To fix that you need to go to File -> Settings -> Code Style -> Java And click the Imports tab.
Now just check the same settings as the image below or just select Default on top in the drop down Scheme.
Then you can just make sure you have the regular Auto Import setting so android studio Auto imports your classes.