0

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?

Channel import

2 Answers 2

0

You can use android.net.wifi.p2p.WifiP2pManager.* instead of android.net.wifi.p2p.WifiP2pManager .It will be loaded all methods in this wifip2Manager.

0

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.

enter image description here

Then you can just make sure you have the regular Auto Import setting so android studio Auto imports your classes.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .