Suddenly, Android Studio start to show /* compiled code */ not detail - android-studio

As image I attached, Android studio does not show detail code about some library classes.
For example I cannot see the detail code about ```Iterable.filter````
Even though I click the "Download Sources" button and "Choose Sources", there is no luck.
It's totally not working.
Is there any workaround?

Since Kotlin is an open-source programming language, you can use Github and look through the source code in there.
https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/common/src/generated/_Collections.kt

Related

code don't show when open new project in android studio

When I make a new project in Android Studio, I don't see any code files in the "Project" pane; instead, I see "External Libraries" and "Scratches and Consoles". Android Studio used to show code. I've tried following steps in tutorials, but they all seem to automatically see the code, and don't explain how to show it. Here's a screenshot of what I see:
As you can see the 'Project' written over there , in the right side their is a drop down. Click over there and you can see many options, but click on the last option named "Android". Their you can find that its showing 'app' and 'Gradle Scripts'. Click on the app drop down and go to java and res file
You can see your code.

How to translate using translations editor in Android Studio?

In my project, I have lots of string resources. Now that I am planning for release of my first ever app, I wanted to translate those to some widely used languages. However, I was unable to find the translate button there. This may seem dumb, but I am searching for it from an hour or so. I even have latest version of android studio installed. I gone through this docs and it was no help. Can someone please tell me how to translate strings using translations editor?
Well, in my case it does show a notification when I open strings.xml (res -> values -> strings.xml) saying: "Edit translations for all locales in the translations editor" and then, in the right, it has two options: "Open editor" which opens the translation editor in a new tab and "Hide notification" which hides that notification.
Now, I think if you can't see that you might have accidentally hidden that notification. If so, you can also open the translation editor by opening Project tab (left), then find your strings.xml file (res -> values -> strings.xml) and right-click on it. In my version (Chipmunk | 2021.2.1) the bottom option says Open Translations Editor. Click it and you're right in the translations editor! As for the question, it does seem a little dumb, but I understand you're a beginner (and I was one too some time ago), so there's no problem!
Hope it helps and your app succeeds!
Good luck! :)
The notification about the translation editor:

Decompile button (kotlin to java) in Android Studio is disappeared?

I'm trying to decompile kotlin code to java.
This question describes how to do it
I have to see something like this:
But in fact i see next one.
As you can see I do NOT have a "Decompile" button
Android Studio 3.5
Can anybody help me please?
make sure you have this plugin enabled, should work after
Go to Extensions and look for "Java Bytecode Decompiler".
Install it and do a complete restart to the Android Studio. Don't just close and open the project, restart the whole program.
Then, when the Android Studio will pop open again, click on "Search Everywhere" (by clicking shift twice), look for "Java Bytecode Decompiler", and make sure it's turned into ON.
That's it. Now the button should be visible.

Content_Main and Activity_Main in Android Studio 1.4: If I put a button in activity_main, but not content_main, will the java file know about it?

I'm a beginner to android but have done a little with an older version of Android Studio, and in the new version I'm having a lot of trouble getting the java file to find buttons or ImageViews. I'm not sure if it's related to the content_main vs activity_main thing. I'm having trouble finding any answers as to how this works on Google, so I'm just starting here, I want to put a button on the main page of my app and have the java file that correlates to the XML file find it. How do I do this?
Answers online are very vague to me, things like "activity_main.xml will determine how the look of the main activity should be. And on the other hand content_main.xml will determine the contents in the activity_main.xml" does not mean anything to me. Please tell me where to put the button!
If you are adding a button in activity_main rather than content_main it cannot be recognized by your Java file. Not only that is will even not be visible on your app.

Android Studio Plugin - Show Image In Editor

I'd like to be able to display an image below a class-level javadoc in Android Studio. My assumption is that I should write a plugin to make this happen.
Does anyone know what I need to do to get an image (JPEG or PNG) to display below a class-level javadoc comment in a Java class file?
I looked into basic information about creating an IntelliJ IDEA plugin but I have no idea where to look to accomplish my task.
This is not possible in the current version of IntelliJ IDEA. The editor can display only text, and does not support embedding of non-text things such as an image file.
You can display images on hover, or in popups, or in dialogs, but not within the editor itself.
Do you want the image to show in the class' source code itself? As an aside, images in Javadocs will show when you view the formatted javadoc view the Quick documentation action (Windows/Linux: Ctrl+Q or Mac: ^J)
If you still want the image to show in the source code, then yes, you will need to write a plug-in. You can look at the Information for Plugin Developers
Setting Up the Plugin Development Environment section of this web page - https://www.jetbrains.com/idea/plugins - to get started. You'll have to dig through source code to try and find some ideas for how to display an image in the source code. As much as I love IntelliJ IDEA, there plug-in documentation is a bit weak. When I wrote a plug-in, I had to do a lot of looking through the IDEA code to find code that was doing things similar to what I wanted to do. I also downloaded the source code for some of the better plug-ins out there and looked through them.
Finally, you can ask for some guidance in the IntelliJ IDEA Open API and Plugin Development forum. That forum is monitored by JetBrains developers. Your best bet to getting answers in that forum is to ask very specific questions. Do not try and get someone to explain from start to finish what you need to do. As you do each step, ask questions about what you are trying to do.

Resources