Leo Aso
Leo Aso

Reputation: 12493

How to ignore java.time package in Android Studio

I am currently working on an Android Studio project with a minimum API version of 17 (JellyBean), so I cannot use the java.time package. Instead, I am using the ThreeTen backport for Android (com.jakewharton.threetenabp:threetenabp:1.1.0).

My problem is that every class in com.threeten.bp matches one in java.time, and I find that it is very easy to accidentally import the wrong class, since the auto-complete popup shows the java.time option first. I need a way to just remove that java.time package from my project, or at least tell Android Studio to ignore it. Is it possible to do that?

Upvotes: 6

Views: 153

Answers (1)

xingbin
xingbin

Reputation: 28289

You can disable auto-import classes of this package. Add java.time into:

Editor--> General --> Auto import --> exclude from import and completion

Upvotes: 5

Related Questions