当前位置:网站首页>How to pass custom object via intent in kotlin
How to pass custom object via intent in kotlin
2022-07-04 08:39:00 【Rich in starch】
problem :
fun launchNextScreen(context: Context, people: People): Intent { val intent = Intent(context, NextScreenActivity::class.java) intent.putExtra(EXTRA_PEOPLE, (Parcelable) people) //intent.putExtra(EXTRA_PEOPLE, people as Parcelable) //intent.putExtra(EXTRA_PEOPLE, people) // tried above all three ways return intent}
I tried the above code to pass an instance of the People
class via intent using kotlin, but I am getting an error. I try to use the code above kotlin Through intention People
Class , But something went wrong .What am I doing wrong? What on earth did I do wrong ?
Solution :
Reference resources : https://stackoom.com/en/question/3DhAL边栏推荐
- 如何通过antd的upload控件,将图片以文件流的形式发送给服务器
- Snipaste convenient screenshot software, which can be copied on the screen
- 【无标题】转发最小二乘法
- [Chongqing Guangdong education] National Open University spring 2019 455 logistics practice reference questions
- [test de performance] lire jmeter
- How to send pictures to the server in the form of file stream through the upload control of antd
- How to set multiple selecteditems on a list box- c#
- ctfshow web255 web 256 web257
- How to solve the problem of computer jam and slow down
- Cannot click button when method is running - C #
猜你喜欢
Private collection project practice sharing [Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources
DM8 database recovery based on point in time
微服务入门:Gateway网关
Redis 哨兵机制
How college students choose suitable computers
Newh3c - network address translation (NAT)
How does Xiaobai buy a suitable notebook
1、卡尔曼滤波-最佳的线性滤波器
Codeforces Round #803 (Div. 2)(A-D)
转:优秀的管理者,关注的不是错误,而是优势
随机推荐
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,Gauss-Jordan消去法,源代码
Sort by item from the list within the list - C #
如何通过antd的upload控件,将图片以文件流的形式发送给服务器
How does Xiaobai buy a suitable notebook
awk从入门到入土(9)循环语句
没有Kubernetes怎么玩Dapr?
MySQL relearn 1-centos install mysql5.7
manjaro安装微信
Go zero micro service practical series (IX. ultimate optimization of seckill performance)
[CV] Wu Enda machine learning course notes | Chapter 9
DM8 uses different databases to archive and recover after multiple failures
Moher College webmin unauthenticated remote code execution
Collections in Scala
Comprendre la méthode de détection des valeurs aberrantes des données
snipaste 方便的截图软件,可以复制在屏幕上
es6总结
4 small ways to make your Tiktok video clearer
@Role of pathvariable annotation
ArcGIS应用(二十二)Arcmap加载激光雷达las格式数据
DM8 tablespace backup and recovery