谁还没个明天 2010-01-26 11:52 采纳率: 50%
浏览 457
已采纳

如何使用 Intents 将一个对象从一个 Android 活动发送到另一个?

How can I pass an object of a custom type from one Activity to another using the putExtra() method of the class Intent?

转载于:https://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-using-intents

  • 写回答

30条回答 默认 最新

  • ℡Wang Yan 2010-02-10 11:52
    关注

    the most easiest solution i found is.. to create a class with static data members with getters setters.

    set from one activity and get from another activity that object.

    activity A

    mytestclass.staticfunctionSet("","",""..etc.);
    

    activity b

    mytestclass obj= mytestclass.staticfunctionGet();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(29条)

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用