2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

はじめに

リファクタ系の作業をしていると、うっかり不要なインポートが差分に残っていてレビュー時に指摘をいただいたり、コミットした後に気がついて再度コミットしないといけなかったりして、不要な二度手間をさくことになっていませんか?
私もプロジェクトを跨いでいたりするとうっかりしてしまうことがあるのですが、このうっかりを防ぐことが可能な設定がありますので、備忘録的に残しておこうと思います。

設定方法

まずは、【AndroidStudio】 > 【Settings】 より設定画面を表示します。

次に、上記画像でもあるように、【Editor】 > 【General】 > 【Auto Import】 を選択して表示します。
検索窓からAuto Importと検索することでも確認可能です。

Auto Import設定より、【Add unambiguous imports on the fly】にチェックを入れてください。
KotlinであればKotlin内のものを、JavaであればJava内のものにチェックを入れてもらえればと思います。

これで不要なインポートを自動で整理可能です。

さいごに

子供からの風邪は強すぎるので、みなさんお気をつけください、、、

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?