Passing data through intent using Serializable

前端 未结 11 1634
借酒劲吻你
借酒劲吻你 2020-11-22 13:35

I\'ve implemented my class with serializable, but it still didn\'t work.

This is my class:

package com.ursabyte.thumbnail;

import java.io.Serializab         


        
11条回答
  •  旧时难觅i
    2020-11-22 13:48

    Try to pass the serializable list using Bundle.Serializable:

    Bundle bundle = new Bundle();
    bundle.putSerializable("value", all_thumbs);
    intent.putExtras(bundle);
    

    And in SomeClass Activity get it as:

    Intent intent = this.getIntent();
    Bundle bundle = intent.getExtras();
    
    List thumbs=
                   (List)bundle.getSerializable("value");
    

提交回复
热议问题