android: problem with Serializable object put into intent

后端 未结 4 928
时光取名叫无心
时光取名叫无心 2020-12-18 07:03

Hi i have problem with a class i want to pass in an intent by putting it into the putExtras() Its serializable and the code looks like this:

public abstract          


        
4条回答
  •  独厮守ぢ
    2020-12-18 08:02

    How are you declaring ObjectB before you pass it into the bundle? From what I understand of your question you are getting no error when you pass in the bundle, only when removing it. Try retreiving your ObjectB into an ObjectB type directly like this:

    ObjectB y = (ObjectB) getIntent().getExtras().get("blabla");
    

提交回复
热议问题