I am getting a ANR while binding a service from another application. The Anr is "Timeout executing service". Below is the log-

**App.class :-** 

```
onCreate {
//code
}

```

**Service.class**

```
Add some code here for reference

```

**Logs :-**

> 
> 11-11 10:15:24.880 2690 2754 I ActivityManager: Start proc 5187:com.xxxx.yyyy.myapp/u0a36 for service com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService  
> 
>  11-11 10:15:27.279 2690 3965 V ActivityManager: >>> EXECUTING create of ServiceRecord{9df34f9 u0 com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService} in app ProcessRecord{dd89a9f 5187:com.xxxx.yyyy.myapp/u0a36}  
> 
>  11-11 10:15:27.281 2690 3965 V ActivityManager: >>> EXECUTING bind of ServiceRecord{9df34f9 u0 com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService} in app ProcessRecord{dd89a9f 5187:com.xxxx.yyyy.myapp/u0a36}  
> 
>  11-11 10:15:46.892 5187 5187 D Myapp: onCreate()  
> 
>  11-11 10:15:47.281 2690 2754 W ActivityManager: Timeout executing service: ServiceRecord{9df34f9 u0 com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService}  
> 
>  11-11 10:15:47.452 2690 3210 V ActivityManager: <<< DONE EXECUTING ServiceRecord{9df34f9 u0 com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService}: nesting=2, inDestroying=false, app=ProcessRecord{dd89a9f 5187:com.xxxx.yyyy.myapp/u0a36}  
> 
>  11-11 10:15:47.453 2690 3232 V ActivityManager: <<< DONE EXECUTING ServiceRecord{9df34f9 u0 com.xxxx.yyyy.myapp/.speechrecognition.MyOwnService}: nesting=1, inDestroying=false, app=ProcessRecord{dd89a9f 5187:com.xxxx.yyyy.myapp/u0a36} 
> 
> 
> 

Here we see that the time difference between "ActivityManager: >>> EXECUTING bind of ServiceRecord" and "Myapp: onCreate()" ( which is 1st line is of Myapp ) is almost 19 seconds. Please note My application "Myapp" has not been created while bind request of its service "MyOwnService" done. Problem is myapplication has just starts to initialize when 19 seconds already over.

What could be the reason that ActivtyManager/ActiviyService of Android is taking too much time to launch my application.?