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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.