Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No reference documentation in Android Studio

A new problem just popped up yesterday. When I hover over a method or press Ctrl-Q, I used to get documentation info for that particular method.

But now I just get (pressing Ctrl-Q on SharedPreferences.getLong()):

Following external urls were checked:
            http://developer.android.com/reference/android/content/SharedPreferences.html#getLong-java.lang.String-long-
            http://developer.android.com/reference/android/content/SharedPreferences.html#getLong(java.lang.String, long) 

    The documentation for this element is not found. Please add all the needed paths to API docs in Project Settings.
        android.content.SharedPreferences
        public abstract long getLong(String s, long l)

I googled a lot, but couldn't find an answer. Which paths do I need to add and where?

like image 440
j3App Avatar asked Aug 23 '18 15:08

j3App


People also ask

What is FindViewById Android studio?

FindViewById(Int32) Finds a view that was identified by the android:id XML attribute that was processed in #onCreate . FindViewById<T>(Int32) Finds a view that was identified by the id attribute from the XML layout resource.

How do I download documents for Android SDK?

Open SDK Manager (located in android_sdk_dir/SDK Manager.exe ). In the latest API (4.2) select Documentation for Android SDK . Once downloaded, you can find the documentation in android_sdk_dir/docs .

What is API interface in Android Studio?

It is used for exchanging information with a website, either by receiving or by sending data. A web API typically consists of multiple publicly exposed endpoints that accept HTTP requests and respond with the requested data, typically in the form of JSON or XML.

Does Android have API?

The Android Management API is available as part of Android Enterprise, an initiative providing developers with tools to build solutions for organizations to manage their Android device fleets. The program is intended for enterprise mobility management providers (EMMs).


2 Answers

Note: as of AS 3.6.2 (or, maybe, even earlier) this is irrelevant and does not answer the question.

Answer for older Android Studio versions:

You Must Download Documentation for Android SDK from SDK Manager

screenshot

like image 102
5ec20ab0 Avatar answered Oct 20 '22 04:10

5ec20ab0


So for me the solution in Android Studio 4.1.1 was that I forgot to download the sources for SDK 30.

  1. Go to Tools > SDK Manager
  2. Check Show Package Details
  3. See if Sources for Android 30 is checked
like image 30
Cyn45 Avatar answered Oct 20 '22 04:10

Cyn45