Missing the android.os.handler object from Android Studio

21,819

Solution 1

I had to add import android.os.*; before I could get the android.os.Handler object working in my class.

Solution 2

Just import android.os.Handler, no need to import everything in android.os

Solution 3

open : Settings -> Editor -> General -> Auto Import。

Exclude from Import

Solution 4

import android.os.*;

solved the problem.

Share:
21,819
b1kjsh
Author by

b1kjsh

Updated on July 09, 2022

Comments

  • b1kjsh
    b1kjsh almost 2 years

    I'm attempting to create a Handler thread in my application however Android Studio marks my text as red and will only attempt to import the java.util version of a handler and not the Android SDK version. When attempting to import manually I'm able to find the HandlerThread just fine but the normal handler import seems to be missing.

    Any ideas why?