Hey I'm not sure what happened but I refactored an Android project of mine recently. When I type the name of a new class the drop down menu appears as usual, prompting me to import it on the fly.
The weird thing is when I press enter halfway through typing the name of my new class, instead of importing the class, it just inserts the entire package name.
i.e.:
MyObject object = new com.example.MyObject();
Has anybody experienced this before?
Step by Step Implementation Step 2: Now click on the setting gear icon and deselect Compact Middle Packages. Step 3: Now the packages folder is broken into parts as shown in the below image. Step 4: Now right-click on the first package name (com) and Refactor > Rename.
It shouldn't matter. In case you still wish to change, you have to unpublish your app and publish it as a new app. This is because Google identifies your app through you bundle ID, or package name as it is called. So you cannot repeat 2 package names.
This happened to me recently. My solution was to uncheck the "Use fully qualified class names" option under File
--> Settings
--> Editor
--> Code Style
--> Java
--> Imports
(tab)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With