Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable javadoc for the Android support library?

When using the Android support library for compatibility and try to view the javadoc for, say, FragmentTransaction, I get the following error because there is no associated javadoc file:

android.support.v4.app.FragmentTransaction

Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.

The support library is added under the Android Dependencies item in the project properties, and shows Javadoc location: (None) - non-modifiable as shown below. Is there any workaround for this?

enter image description here

like image 439
Jeff Axelrod Avatar asked Sep 27 '12 19:09

Jeff Axelrod


People also ask

What is the Android support library?

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level.

Which v7 support libraries are used for modifying UI settings?

v7 Preference Support Library The preference package provides APIs to support adding preference objects, such as CheckBoxPreference and ListPreference , for users to modify UI settings. The v7 Preference library adds support for interfaces, such as Preference. OnPreferenceChangeListener and Preference.


1 Answers

I've lashed together a project with android-support-v4.jar just in the Android Dependencies part of the package view. I have a class

public class CountriesFragment extends ListFragment {...} 

and an import of

import android.support.v4.app.ListFragment; 

up above

I created a file android-support-v4.jar.properties in the libs folder. It contains the lines:

doc=c:\\[path-to-android-sdk]\\docs\\reference src=C:\\[path-to-android-sdk]\\extras\\android\\support\\v4\\src 

Presumably you'll have to change to un-escaped forward slashes if not using Windows.

Next right-click the project, select refresh, then you'll get javadoc support. You don't really need the doc entry--the src entry already contains the javadocs.

like image 199
NickT Avatar answered Sep 25 '22 22:09

NickT