本文整理匯總了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;
}