MbmsDownloadSession.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(Context, IExecutor, MbmsDownloadSessionCallback) |
Create a new |
Create(Context, IExecutor, Int32, MbmsDownloadSessionCallback) |
Create a new MbmsDownloadManager using the given subscription ID. |
Create(Context, IExecutor, MbmsDownloadSessionCallback)
Create a new MbmsDownloadSession
using the system default data subscription ID.
[Android.Runtime.Register("create", "(Landroid/content/Context;Ljava/util/concurrent/Executor;Landroid/telephony/mbms/MbmsDownloadSessionCallback;)Landroid/telephony/MbmsDownloadSession;", "", ApiSince=28)]
public static Android.Telephony.MbmsDownloadSession? Create (Android.Content.Context context, Java.Util.Concurrent.IExecutor executor, Android.Telephony.Mbms.MbmsDownloadSessionCallback callback);
[<Android.Runtime.Register("create", "(Landroid/content/Context;Ljava/util/concurrent/Executor;Landroid/telephony/mbms/MbmsDownloadSessionCallback;)Landroid/telephony/MbmsDownloadSession;", "", ApiSince=28)>]
static member Create : Android.Content.Context * Java.Util.Concurrent.IExecutor * Android.Telephony.Mbms.MbmsDownloadSessionCallback -> Android.Telephony.MbmsDownloadSession
Parameters
- context
- Context
The instance of Context
to use
- executor
- IExecutor
The executor on which you wish to execute callbacks.
- callback
- MbmsDownloadSessionCallback
A callback to get asynchronous error messages and file service updates.
Returns
A new instance of MbmsDownloadSession
, or null if an error occurred during
setup.
- Attributes
Remarks
Create a new MbmsDownloadSession
using the system default data subscription ID. See #create(Context, Executor, int, MbmsDownloadSessionCallback)
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
Create(Context, IExecutor, Int32, MbmsDownloadSessionCallback)
Create a new MbmsDownloadManager using the given subscription ID.
[Android.Runtime.Register("create", "(Landroid/content/Context;Ljava/util/concurrent/Executor;ILandroid/telephony/mbms/MbmsDownloadSessionCallback;)Landroid/telephony/MbmsDownloadSession;", "", ApiSince=28)]
public static Android.Telephony.MbmsDownloadSession? Create (Android.Content.Context context, Java.Util.Concurrent.IExecutor executor, int subscriptionId, Android.Telephony.Mbms.MbmsDownloadSessionCallback callback);
[<Android.Runtime.Register("create", "(Landroid/content/Context;Ljava/util/concurrent/Executor;ILandroid/telephony/mbms/MbmsDownloadSessionCallback;)Landroid/telephony/MbmsDownloadSession;", "", ApiSince=28)>]
static member Create : Android.Content.Context * Java.Util.Concurrent.IExecutor * int * Android.Telephony.Mbms.MbmsDownloadSessionCallback -> Android.Telephony.MbmsDownloadSession
Parameters
- context
- Context
The instance of Context
to use
- executor
- IExecutor
The executor on which you wish to execute callbacks.
- subscriptionId
- Int32
The data subscription ID to use
- callback
- MbmsDownloadSessionCallback
A callback to get asynchronous error messages and file service updates.
Returns
A new instance of MbmsDownloadSession
, or null if an error occurred during
setup.
- Attributes
Remarks
Create a new MbmsDownloadManager using the given subscription ID.
Note that this call will bind a remote service and that may take a bit. The instance of MbmsDownloadSession
that is returned will not be ready for use until MbmsDownloadSessionCallback#onMiddlewareReady()
is called on the provided callback. If you attempt to use the instance before it is ready, an IllegalStateException
will be thrown or an error will be delivered through MbmsDownloadSessionCallback#onError(int, String)
.
This also may throw an IllegalArgumentException
.
You may only have one instance of MbmsDownloadSession
per UID. If you call this method while there is an active instance of MbmsDownloadSession
in your process (in other words, one that has not had #close()
called on it), this method will throw an IllegalStateException
. If you call this method in a different process running under the same UID, an error will be indicated via MbmsDownloadSessionCallback#onError(int, String)
.
Note that initialization may fail asynchronously. If you wish to try again after you receive such an asynchronous error, you must call #close()
on the instance of MbmsDownloadSession
that you received before calling this method again.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.