Android 12 Developer Preview is here! Try it out, and give us your feedback!


public final class MediaTransferReceiver
extends BroadcastReceiver

   ↳ android.content.BroadcastReceiver

A BroadcastReceiver class for enabling Media transfer feature.

Media transfer is a feature that media routing can be controlled via system UI. By using this, media app users can re-route the media without opening the app activity again. Also, the media can be transferred from one device to another device seamlessly, depending on the devices. This feature is supported from Android 11.

To enable the media transfer feature, media apps should declare this receiver in the app's manifest. For example:

     <receiver android:name="" />

Media apps that enable this feature should implement the MediaRouter.Callback properly. Specifically:


Public constructors


Public methods

void onReceive(Context context, Intent intent)

Inherited methods

Public constructors


public MediaTransferReceiver ()

Public methods


public void onReceive (Context context, 
                Intent intent)

context Context

intent Intent