Passing data through intent using Serializable

前端 未结 11 1669
借酒劲吻你
借酒劲吻你 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条回答
  •  感动是毒
    2020-11-22 14:00

    You need to create a Bundle and then use putSerializable:

    List all_thumbs = new ArrayList();
    all_thumbs.add(new Thumbnail(string,bitmap));
    Intent intent = new Intent(getApplicationContext(),SomeClass.class);
    
    Bundle extras = new Bundle();
    
    extras.putSerializable("value",all_thumbs);
    intent.putExtras(extras);
    

提交回复
热议问题