3 Replies - 966 Views - Last Post: 04 October 2019 - 11:46 AM

#1 rblz   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 26
  • Joined: 23-May 19

Android Studio: Can't use "import" statement

Posted 04 October 2019 - 10:41 AM

I have an Android Studio project. I have a directory with my "MainActivity". In that directory, I created a new Java file, and basically when I try to use the import statement in that Java file, and that Java file alone, when I complete the import statement and press the semicolon, the import statement just disappears. I don't press enter or anything - simply pressing the semicolon causes the statement to disappear, and I'm not sure why this happens. I made a GIF of it happening: https://imgur.com/a/We6tyTE

Is This A Good Question/Topic? 0
  • +

Replies To: Android Studio: Can't use "import" statement

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15361
  • View blog
  • Posts: 61,605
  • Joined: 12-June 08

Re: Android Studio: Can't use "import" statement

Posted 04 October 2019 - 10:49 AM

Is this happening inside Android Studio? If so you should submit a bug report to them.
Was This Post Helpful? 0
  • +
  • -

#3 rblz   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 26
  • Joined: 23-May 19

Re: Android Studio: Can't use "import" statement

Posted 04 October 2019 - 11:40 AM

Yeah it is. Doesn't seem like it could be a bug though because it seems like something so common it would have been reported by now.
Was This Post Helpful? 0
  • +
  • -

#4 rblz   User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 26
  • Joined: 23-May 19

Re: Android Studio: Can't use "import" statement

Posted 04 October 2019 - 11:46 AM

Nevermind; I figured it out. Basically I had "Optimize imports on the fly turned on." Thanks anyways.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1