Skip to main content
replaced http://android.stackexchange.com/ with https://android.stackexchange.com/
Source Link

I cannot give my assurance for the mini-PC you've got, but the following works well on my Nexus 6 running stock Android 6.0.1 with MX Player v1.8.3.

Alright, so discard whatever actions you've setup and follow this simple one:

Code → Run Shell →

  • Command:

     am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file://FILE" --user ID --activity-clear-task
    

where,

Example command:

    am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file:///sdcard/Movies/The egg of the King.mp4" --user 0 --activity-clear-task

If MX Player is the default video player in your Android, for fun, you can replace -n com.mxtech.videoplayer.ad/.ActivityScreen with -a android.intent.action.VIEW in the said command.

  • tick Continue Task After Error

You can now setup a wait timer or anything that you intend to do after the execution of that action. In order to fire a new video, just copy everything from aforesaid action except of FILE which needs to be replaced with new file location.

In case Tasker doesn't work out, try with Automate. It has a neat block named App Start which is specifically meant to launch an activity of an app.

(Click image to enlarge it)

IMG:

I cannot give my assurance for the mini-PC you've got, but the following works well on my Nexus 6 running stock Android 6.0.1 with MX Player v1.8.3.

Alright, so discard whatever actions you've setup and follow this simple one:

Code → Run Shell →

  • Command:

     am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file://FILE" --user ID --activity-clear-task
    

where,

  • FILE refers to the location of your media file in Android. E.g. /sdcard/Movies/lolcat.mkv, /storage/emulated/0/Prime_time/after_dark.mkv and so on.
  • ID refers to the ID of the user account currently active. For primary user, it is always 0.
  • --activity-clear-task is a flag which makes sure no multiple instances of the same activity are spawned.

Example command:

    am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file:///sdcard/Movies/The egg of the King.mp4" --user 0 --activity-clear-task

If MX Player is the default video player in your Android, for fun, you can replace -n com.mxtech.videoplayer.ad/.ActivityScreen with -a android.intent.action.VIEW in the said command.

  • tick Continue Task After Error

You can now setup a wait timer or anything that you intend to do after the execution of that action. In order to fire a new video, just copy everything from aforesaid action except of FILE which needs to be replaced with new file location.

In case Tasker doesn't work out, try with Automate. It has a neat block named App Start which is specifically meant to launch an activity of an app.

(Click image to enlarge it)

IMG:

I cannot give my assurance for the mini-PC you've got, but the following works well on my Nexus 6 running stock Android 6.0.1 with MX Player v1.8.3.

Alright, so discard whatever actions you've setup and follow this simple one:

Code → Run Shell →

  • Command:

     am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file://FILE" --user ID --activity-clear-task
    

where,

  • FILE refers to the location of your media file in Android. E.g. /sdcard/Movies/lolcat.mkv, /storage/emulated/0/Prime_time/after_dark.mkv and so on.
  • ID refers to the ID of the user account currently active. For primary user, it is always 0.
  • --activity-clear-task is a flag which makes sure no multiple instances of the same activity are spawned.

Example command:

    am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file:///sdcard/Movies/The egg of the King.mp4" --user 0 --activity-clear-task

If MX Player is the default video player in your Android, for fun, you can replace -n com.mxtech.videoplayer.ad/.ActivityScreen with -a android.intent.action.VIEW in the said command.

  • tick Continue Task After Error

You can now setup a wait timer or anything that you intend to do after the execution of that action. In order to fire a new video, just copy everything from aforesaid action except of FILE which needs to be replaced with new file location.

In case Tasker doesn't work out, try with Automate. It has a neat block named App Start which is specifically meant to launch an activity of an app.

(Click image to enlarge it)

IMG:

Source Link
Firelord
  • 25.3k
  • 21
  • 126
  • 292

I cannot give my assurance for the mini-PC you've got, but the following works well on my Nexus 6 running stock Android 6.0.1 with MX Player v1.8.3.

Alright, so discard whatever actions you've setup and follow this simple one:

Code → Run Shell →

  • Command:

     am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file://FILE" --user ID --activity-clear-task
    

where,

  • FILE refers to the location of your media file in Android. E.g. /sdcard/Movies/lolcat.mkv, /storage/emulated/0/Prime_time/after_dark.mkv and so on.
  • ID refers to the ID of the user account currently active. For primary user, it is always 0.
  • --activity-clear-task is a flag which makes sure no multiple instances of the same activity are spawned.

Example command:

    am start -n com.mxtech.videoplayer.ad/.ActivityScreen -d "file:///sdcard/Movies/The egg of the King.mp4" --user 0 --activity-clear-task

If MX Player is the default video player in your Android, for fun, you can replace -n com.mxtech.videoplayer.ad/.ActivityScreen with -a android.intent.action.VIEW in the said command.

  • tick Continue Task After Error

You can now setup a wait timer or anything that you intend to do after the execution of that action. In order to fire a new video, just copy everything from aforesaid action except of FILE which needs to be replaced with new file location.

In case Tasker doesn't work out, try with Automate. It has a neat block named App Start which is specifically meant to launch an activity of an app.

(Click image to enlarge it)

IMG: