Missing import after semicolon (Android studio 2.1)

404 views Asked by At

When i am writing line: import android.bluetooth.BluetoothAdapter; in the android studio,

The above line gets disappear as soon as i hit enter after the semicolon.

Could it be due to line: import android.support.v7.app.AppCompatActivity;

And when the TextView import line disappears,also there is no + sign hence there is definitely no line folding. Please propose some solution to help me as I couldn't find any solution online. Is frustrating.

3

There are 3 answers

0
Sadiq Md Asif On BEST ANSWER

Go to Settings > Editor > General > Auto Import

Uncheck Optimize import on the Fly

1
Dwijraj Bhattacharyya On

Its because you haven't used any object of bluetooth adapter instatiate a object of that class and it will automatically be visible... fading of import statement means its redundant

2
Sadiq Md Asif On

to import any class you should use like this

import root.subroot.classname; 

here you are making a mistake import.name;

change

import.android.bluetooth.BluetoothAdapter;

to

import android.bluetooth.BluetoothAdapter;