AndroidStudio-Parcelable automatically generates code plug-ins for installation and use. androidstudio
Here we use the mac version of AndroidStudio
1. execute the combination shortcut key command + ",", Open the AS preference settings page, find the plugin option, enter Parcelable search, and click install plugin on the right, after installation, you will be prompted to restart the
2. After the plug-in is installed, you can use it to create a Person class. For example, there are four attributes: username, password, age, and isGay.
/*** Created by hailonghan on 15/5/28. */public class Person {private String username; private String password; private int age; private boolean isGay ;}
3. Run the shortcut key Command + N, as shown in the following figure. Select the last one.
4. Click OK Next, for example:
5. The plug-in will automatically generate the following code, which is very efficient, as shown in the figure below: