If it works, then service obviously is an instance of LocalService.LocalBinder . Nothing illegal in casting, it just might fail if you're casting wrong things..