android – Reference resources in javadoc-ThrowExceptions

Exception or error:

Is it possible to reference resource files (e.g. layout files) in javadoc? I could not find this in the developer docs.

How to solve:

Yup it is,

In your javadoc: {@link com.yourApp.R.layout#layoutName}

###

I’ve used #

{@link R.layout#dialog_player_info}

instead of a dot

{@link R.layout.dialog_player_info}

And now it’s all OK. Before I was getting this error in Android Studio

Cannot resolve symbol 'R.layout.dialog_player_info' less... (Ctrl+F1) 
This inspection points out unresolved references inside javadoc

###

Yes, but the whole process may involve

  • creating a temp folder
  • copy your source files into this temp folder
  • copy your layout files into this folder (possibly in a doc-files subfolder)
  • running the Javadoc command from this temp folder

Leave a Reply

Your email address will not be published. Required fields are marked *