79380878

Date: 2025-01-23 11:42:54
Score: 0.5
Natty:
Report link

I found a hack or workaround what ever! What I did.

  1. I found that my dependency "androidx.activity:activity" is located at https://maven.google.com/
  2. Then I downloaded source file activity-1.8.2-sources.jar from those site
  3. In Android Studio I pressed F4 on method, wich has't documentation in my case it was method ActivityresultLauncher.GetContent().
  4. In opened window, like on screenshot [![enter image description here][1]][1], I pressed "Choose Sources" in the top right corner and it opens the select file window.
  5. In this window, I copied the path to folder where file classes.jar is located. Do not close this window in order to not open it later on step 7.
  6. Then opened it in Explorer (I work on Windows10 OS) and put downloaded (on step 2) file here. I understand it will be deleted by my OS later maybe :). If so, I will repeat those steps again.
  7. Then go back to Android Studio where we can see still opened select file window. In this file tree we can see appeared file activity-1.8.2-sources.jar, and we select this file instead of classes.jar.

And its worked! Now I can see documentation for necessary methods and classes in the dependency "`androidx.activity:activity`".
Damn! I understand, that it is not a normal solution.
So how did I come to it?

I was in need of ActivityResultLauncher documentation for my example above. So first of all I removed dependency "androidx.activity:activity" from my build.gradle app file, then Sync and rebuild project, and I noticed that there was no errors on rebuild project.
And more over, after that, I saw documentation for ActivityResultLauncher. "It's a miracle! But how?!" - I thought.
It confused me, so I decided not to stop on this "solution".

So also I noticed that this documentation is taken from dependency version 1.8.0 whereas my removed dependency from build.gradle had version 1.8.2. HMM... OK... Let's move on!

By removing other similar dependencies in app build.gradle file I figured out, that dependency "androidx.activity:activity", where the class ActivityResultLauncher is located, is contained in other app dependency: "androidx.activity:activity-compose".
OK...

Since compose dependency version of "androidx.activity:activity-compose" was old in my project (compose bom had version 2024.05.00), so I decided to change this dependency version to actual. For this moment it is 2025.01.00.

After sync gradle and rebuild project documentation for `ActivityresultLauncher` is gone again, but library version of dependency "`androidx.activity:activity`" became `1.8.2`. OK. Upgrading compose bom version to actual helped, but as I said earlier documentation is gone. And after that I discovered the hack I started this comment with.

Whew! I think it is not normal solution. IDE should download necessary documentation by itself.

And I also think that it may be helps in similar documentation problems

Reasons:
  • Blacklisted phrase (1): this document
  • Blacklisted phrase (1): enter image description here
  • Whitelisted phrase (-2): I figured out
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Eugene Myname