Qzee
Qzee

Reputation: 15

Missing import after semicolon (Android studio 2.1)

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.

Upvotes: 0

Views: 403

Answers (3)

Sadiq Md Asif
Sadiq Md Asif

Reputation: 902

Go to Settings > Editor > General > Auto Import

Uncheck Optimize import on the Fly

Upvotes: 0

Sadiq Md Asif
Sadiq Md Asif

Reputation: 902

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;

Upvotes: 2

Dwijraj Bhattacharyya
Dwijraj Bhattacharyya

Reputation: 349

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

Upvotes: 0

Related Questions