2

I want to mention a layout in my Javadoc which converted from java to Kotlin. In java it was:

/**
* ... inside the {@link R.layout#view_main}
*/

which was clickable, but when I converted this class using android studio tools. It is changed to:

/**
* ... inside the [R.layout.view_main]
*/

which is not clickable. How can I make it clickable?

AliSh
  • 10,085
  • 5
  • 44
  • 76

2 Answers2

2

We need to import the R class into the class for which we are writing documentation. Otherwise, it will not be clickable. It was solved in this way:

import my.app.R
/**
* text description [R.layout.activity_main]
*/
AliSh
  • 10,085
  • 5
  • 44
  • 76
1

in kotlin source link in the document comment will add like this

/**
 * text description
 * @see R.layout.activity_main
 *
 */

or link with the description in the same line will be like this

/**
 * text description @see [R.layout.activity_main]
 */

--

/**
 * text description @see [android.util.AndroidException] and this @see [android.util.AttributeSet]
 */
Priyanka
  • 3,369
  • 1
  • 10
  • 33