I have integrated marshmallow permissions dialog according to new material design, but permission dialog is working on emulator but not on real device. and also i am not getting any error. can any one please help me?

I am using below code:-

ActivityCompat.requestPermissions(this,
 new String[]{Manifest.permission.ACCESS\_COARSE\_LOCATION, Manifest.permission.ACCESS\_FINE\_LOCATION},
 MY\_PERMISSIONS\_REQUEST\_LOCATION);