Handler is abstract ,cannot be instantiated

后端 未结 6 654
一向
一向 2020-12-07 13:03

I am trying to use a Handler in my app. But when i instantiate it like this:

Handler handler = new Handler();

I get the follow

6条回答
  •  太阳男子
    2020-12-07 13:40

    It seems like you have implemented the wrong Handler class

    import java.util.logging.Handler;

    Change it to

    import android.os.Handler;

提交回复
热议问题