Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Alternative way to importing classes manually?

I’m trying to code a simple android app for something and I was wondering if there was an alternative to importing each class manually, or why it shows up as red since anytime I write something in a similar way it won’t run. android studio screenshot

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

To answer the first part:
Yes there is a way to import classes manually. You could look through the code of the dependency and manually create the import statement. This is highly discouraged since it is tedious, time consuming and your IDE (IntelliJ IDEA in your case) is fully able to do this. But if you want to do it this way you can learn something about it here.

To your second part:
It shows red because the classes don’t exist or are not imported. As you know. To help more we will need the a screenshot of the error when you hover over the red text BUT if you think/know it is an import error you can try this:

Hover over the red text and click Import Class if it shows up.

If it does not show up, it means it does not exist or an other error is present. Then we will need a screenshot of the error to help further.

Small hint (if you did not know already): When typing press ctrl+space a windows will pop up with suggestions for autocompletion. Select your options with Enter (or keep typing to get better suggestions). Move with arrows in the window. IntelliJ will then auto import the class.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading