Why I can't create a package inside another package in Android-Studio?

Viewed 181

I have this:

enter image description here

I had that package called data, then I tried to create the package 'model' inside data, and it ended up being a single package named 'data.model'

If I try to rename it, this is what happens: enter image description here

And If I try to create 'model' inside that one, it says it already exists, and same with 'data' if I try to do it inside the main package.

What can I do?

1 Answers

Packages are hierarchial- if you put "Model" inside "Data", it will always be "Data.Model".

Now in Android studio- it optimizes the structure to not show packages that don't have anything in them than other packages. You can still add classes to Data- but until you do, the UI will not show it independently to simplify the layout. It isn't gone, it's just now showing needless complexity.

Related