当前位置:网站首页>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边栏推荐
- Fault analysis | MySQL: unique key constraint failure
- 2022 gas examination registration and free gas examination questions
- 2022 tower crane driver examination and tower crane driver examination questions and analysis
- awk从入门到入土(14)awk输出重定向
- @Role of pathvariable annotation
- 2022 examination questions for safety managers of metal and nonmetal mines (underground mines) and examination papers for safety managers of metal and nonmetal mines (underground mines)
- How to play dapr without kubernetes?
- PHP converts seconds to timestamps - PHP
- Sort by item from the list within the list - C #
- What if the wireless network connection of the laptop is unavailable
猜你喜欢
ctfshow web255 web 256 web257
Codeforces Global Round 21(A-E)
Comparison between sentinel and hystrix
Unity-Text上标平方表示形式+text判断文本是否为空
广和通高性能4G/5G无线模组解决方案全面推动高效、低碳智能电网
High order phase difference such as smear caused by myopic surgery
NewH3C——ACL
1. Kalman filter - the best linear filter
Codeforces Round #750 (Div. 2)(A,B,C,D,F1)
DM8 tablespace backup and recovery
随机推荐
How to send pictures to the server in the form of file stream through the upload control of antd
How to use C language code to realize the addition and subtraction of complex numbers and output structure
How to choose solid state hard disk and mechanical hard disk in computer
Famous blackmail software stops operation and releases decryption keys. Most hospital IOT devices have security vulnerabilities | global network security hotspot on February 14
C#实现一个万物皆可排序的队列
Comparison between sentinel and hystrix
Newh3c - network address translation (NAT)
The second session of the question swiping and punching activity -- solving the switching problem with recursion as the background (I)
一文了解數據异常值檢測方法
Redis 哨兵机制
awk从入门到入土(14)awk输出重定向
How to set multiple selecteditems on a list box- c#
What if the wireless network connection of the laptop is unavailable
Display Chinese characters according to numbers
DM8 command line installation and database creation
Comprendre la méthode de détection des valeurs aberrantes des données
C # implements a queue in which everything can be sorted
Snipaste convenient screenshot software, which can be copied on the screen
1. Qt入门
How to solve the problem that computers often flash