当前位置:网站首页>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边栏推荐
猜你喜欢
AcWing 244. Enigmatic cow (tree array + binary search)
1. Kalman filter - the best linear filter
How to choose solid state hard disk and mechanical hard disk in computer
DM8 database recovery based on point in time
微服務入門:Gateway網關
Turn: excellent managers focus not on mistakes, but on advantages
Display Chinese characters according to numbers
Manjaro install wechat
[go basics] 1 - go go
snipaste 方便的截图软件,可以复制在屏幕上
随机推荐
awk从入门到入土(8)数组
Cannot click button when method is running - C #
How to choose solid state hard disk and mechanical hard disk in computer
Convert datetime string to datetime - C in the original time zone
How can we make a monthly income of more than 10000? We media people with low income come and have a look
C#实现一个万物皆可排序的队列
[BSP video tutorial] stm32h7 video tutorial phase 5: MDK topic, system introduction to MDK debugging, AC5, AC6 compilers, RTE development environment and the role of various configuration items (2022-
Conversion of yolov5 XML dataset to VOC dataset
Comprendre la méthode de détection des valeurs aberrantes des données
How to re enable local connection when the network of laptop is disabled
PHP converts seconds to timestamps - PHP
微服务入门:Gateway网关
Developers really review CSDN question and answer function, and there are many improvements~
awk从入门到入土(15)awk执行外部命令
Learn nuxt js
Leetcode 23. Merge K ascending linked lists
The right way to capture assertion failures in NUnit - C #
Azure ad domain service (II) configure azure file share disk sharing for machines in the domain service
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
Codeforces Global Round 21(A-E)