Code example for Parcel

Methods: writeInt, writeString

0
	} 
 
	@Override 
	public void writeToParcel(Parcel out, int flags)
	{ 
		super.writeToParcel(out, flags);
		out.writeString(hostname);
		out.writeInt(port);
	} 
 
	@Override 
	public void writeToSharedPreferences(SharedPreferences sharedPrefs)
	{ 
		super.writeToSharedPreferences(sharedPrefs);
		 
		SharedPreferences.Editor editor = sharedPrefs.edit();
		editor.putString("bookmark.hostname", hostname);
		editor.putInt("bookmark.port", port);
		editor.commit();		
	}