软件编程
位置:首页>> 软件编程>> Android编程>> 在Android Studio中Parcelable插件的简单使用教程

在Android Studio中Parcelable插件的简单使用教程

作者:邹奇  发布时间:2022-05-08 17:12:26 

标签:Android,Studio,Parcelable,插件

在Android Studio中,你可以很快速的使用Parcelable插件进行实体类的序列化的实现,使用该插件后,你的实体类可以快速的实现Parcelable接口而不用写额外的代码。因为该插件会帮你快速的生成必须提供的方法,可以说是很高效率的了。

首先需要下载该插件:


在File->Setting->Plugins里的搜索框内输入内容:android parcelable code generator,然后自己下载好重启studio即可使用该插件了。

下载插件界面:

在Android Studio中Parcelable插件的简单使用教程

重启studio:

在Android Studio中Parcelable插件的简单使用教程

点击右键弹出提示框,选择Parcelable生成即可:

在Android Studio中Parcelable插件的简单使用教程

序列化时选择需要的属性:

在Android Studio中Parcelable插件的简单使用教程

最后是自动生成的代码,也表示成功的实现了Parcelable接口:

在Android Studio中Parcelable插件的简单使用教程

怎么样?是不是很高效就实现了Parcelable接口!

哦对了,使用该插件需要你先自己准备好实体类的属性。

来源:http://blog.csdn.net/csdnzouqi/article/details/78617235

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com