本文整理汇总了Java中android.net.Uri.writeToParcel方法的典型用法代码示例。如果您正苦于以下问题:Java Uri.writeToParcel方法的具体用法?Java Uri.writeToParcel怎么用?Java Uri.writeToParcel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.Uri
的用法示例。
在下文中一共展示了Uri.writeToParcel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendFileToDevice
import android.net.Uri; //导入方法依赖的package包/类
public void sendFileToDevice(String deviceId, String mimeType, Uri uri) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(deviceId);
_data.writeString(mimeType);
if (uri != null) {
_data.writeInt(1);
uri.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(9, _data, _reply, 0);
ExceptionUtils.readExceptionFromParcel(_reply);
} finally {
_reply.recycle();
_data.recycle();
}
}
示例2: playMedia
import android.net.Uri; //导入方法依赖的package包/类
public int playMedia(String deviceId, Uri uri, int start) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
int _result = 1;
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(deviceId);
if (uri != null) {
_data.writeInt(1);
uri.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeInt(start);
this.mRemote.transact(13, _data, _reply, 0);
ExceptionUtils.readExceptionFromParcel(_reply);
_result = _reply.readInt();
return _result;
} finally {
_reply.recycle();
_data.recycle();
}
}
示例3: playFromUri
import android.net.Uri; //导入方法依赖的package包/类
public void playFromUri(Uri uri, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (uri != null) {
_data.writeInt(1);
uri.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(16, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例4: mayLaunchUrl
import android.net.Uri; //导入方法依赖的package包/类
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
if (url != null) {
_data.writeInt(1);
url.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeTypedList(otherLikelyBundles);
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
_result = 0 != _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}