DeadObjectException on android app DeadObjectException on android app android android

DeadObjectException on android app


DeadObjectException - The object you are calling has died because its hosting process no longer exists.

From here:

Does this problem happen every time you debug your project?

Override your service's onDestroy() method and watch what event flowleads to it. If you catch DeadObjectException without going throughthis method, your service should have been killed by the OS.

As you are using web API in your fragment so sometimes that will send multiple requests on the server and in terms of response, you are getting @null.

W/Binder  (  899): Caught a RuntimeException from the binder stub implementation.W/Binder  (  899): java.lang.NullPointerException


DeadObjectException extends RemoteException

This Exception means , The object you are calling has died, because its hosting process no longer exists. And check this link for your reference based on DeadObjectException.


In my app i found this bug , but the great thing about this exception is which doesn't occurs in all the devices

after doing lot of R&D i resolved it by removing Typeface , this might be because of ttf which i was using from assets folder Please try comment the typeface and test it hope it will work for sure

When i Got this DeadObjectException my component code looks like this

public class TextViewCust extends TextView {private Context context;private AttributeSet attrs;private int defStyle;public TextViewCust (Context context) {    super(context);    this.context=context;    init();}  public TextViewCust (Context context, AttributeSet attrs) {      super(context, attrs);      this.context=context;      this.attrs=attrs;      init(); }public TextViewCust (Context context, AttributeSet attrs, int defStyle) {      super(context, attrs, defStyle);      this.context=context;      this.attrs=attrs;      this.defStyle=defStyle;      init(); }private void init() {            //This is the line where i got dead Object Exception         Typeface font=Typeface.createFromAsset(getContext().getAssets(), "telugu.ttf");        this.setTypeface(font);  }

Note: When i commented the code in init method i never got that exception even a single time