Handler is abstract ,cannot be instantiated

It seems you have imported a wrong Handler class

import java.util.logging.Handler;

Change it to

import android.os.Handler;

In Place Of

import java.util.logging.Handler; 

add

import android.os.Handler;

also if you use

Handler handler = new Handler() {
    @Override
    public void close() {

    }

    @Override
    public void flush() {

    }

    @Override
    public void publish(LogRecord record) {

    }
};

it will give error that boolean found somthing like error so either use boolean handler = new Handler()... or simply use (new Handler()){....`