Code example for Parcel

Methods: readBooleanArrayreadIntreadStringreadValue

0
 
		@Override 
		public AppInfo createFromParcel(Parcel source) { 
			// TODO Auto-generated method stub 
			AppInfo ai = new AppInfo(); 
			ai.packageName = source.readString(); 
			ai.appName = source.readString(); 
			// ai.icon = Bitmap.CREATOR.createFromParcel(source); 
			ai.icon = (Bitmap) source.readValue(Bitmap.class.getClassLoader()); 
			ai.versionCode = source.readInt(); 
			ai.versionName = source.readString(); 
			boolean[] b = new boolean[1]; 
			source.readBooleanArray(b); 
			ai.isSystemApp = b[0]; 
			ai.pkgInfo = (PackageInfo) source.readValue(PackageInfo.class 
					.getClassLoader()); 
			return ai; 
		} 
 
		@Override