Code example for Parcel

Methods: writeString

0
    public int describeContents() { 
        return 0; 
    } 
 
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mURL);
    } 
 
    public String getURL() {
        return mURL;
    } 
 
    public void onClick(View widget) {
        Uri uri = Uri.parse(getURL());
        Context context = widget.getContext();
        if (uri.getScheme().startsWith("http")) {
            Intent intent = new Intent(context, BrowserWebActivity.class);
            intent.putExtra("url", uri.toString());
            context.startActivity(intent);
        } else { 
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);