parcelable encountered ioexception writing serializable object…?

前端 未结 5 663
旧时难觅i
旧时难觅i 2021-01-19 01:43

The code

SngList.setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView a, View v, int position, long id) {


        In         


        
5条回答
  •  无人共我
    2021-01-19 02:20

    I know where the problem is in your case and that is about the BitMap All you need to do is Decode your BitMap before sending into intent

    Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.thumbsup);
            ByteArrayOutputStream stream = new ByteArrayOutputStream();
            largeIcon.compress(Bitmap.CompressFormat.JPEG, 100, stream);
            byte[] byteArray = stream.toByteArray();
    

    And then send the following Object in intent

    intent.putExtras("remindermessage",object);
    

    and if not about the Bitmap then you should look for other things which might be taking more space and decode them before sending into intent

提交回复
热议问题