문제

I want to create a package-info.java to add package-wise comments, but in current version of Android Studio (I am using 0.5.7 and I don't know about this possibility in older versions) I am facing these issues:

When I right click on package and select NEW, there is no option for creating a package info file. I tried to create a new class and name it package-info.java but the IDE doesn't like this name and does not allow me to create this file.

So I went ahead and created a class file named PackageInfo.java and wrote to it what you usually write in the package-info.java.

The problem is when I use the Generate JavaDoc from Tools menue, it does not care about this file and it contents does not show up.

So I wonder if you have any workaround or something.

도움이 되었습니까?

해결책

The best workaround is to right click on the package, New, File, and create a file called package-info.java. Once it's there the IDE will recognize it as a Java file and you'll get the syntax highlighting and such.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top