Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

134
Views
Why ".kt" extension is sometimes visible and sometimes not?

In on of my Android Studio Kotlin projects, sometimes .KT is shown and sometimes not, in the Project explorer, in the Activity folder.

What is the criteria used by Android Studio to show or hide the .KT extension ?

Thanks

8 months ago · Santiago Trujillo
3 answers
Answer question

0

If a kotlin file has exactly one outer class/object/interface as the same name of the file, then studio shows just the name without extension.

8 months ago · Santiago Trujillo Report

0

This could happen if activity does not meet one or more of these points:

  1. One activity file should contain only one class.
  2. One activity file class name declaration must correspond to the good filename (filename must equals class name).
  3. There are no top-level declarations (constants, variables).
8 months ago · Santiago Trujillo Report

0

Solution :

One activity file should contain only one class.

One activity file class name declaration must correspond to the good filename (filename must equals class name).

8 months ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.