Magnet link intent: No activity found to handle intent

565 views Asked by At

So I have a magnet link and I want to open it in the browser or Flud (exactly what happens when clicking a magnet link in the browser)

My code

class PartViewHolder(itemView: View): RecyclerView.ViewHolder(itemView){
    var img_download = itemView.findViewById(R.id.img_download) as ImageView
    var mcontext = itemView.context

    fun bind(part: PartData, clickListener: (PartData) -> Unit){
        img_download.setOnClickListener(){
            val uri = Uri.parse(magnetlink)
            val intent = Intent(Intent.ACTION_VIEW, uri)
            mcontext.startActivity(intent)

My stack trace

E/AndroidRuntime: FATAL EXCEPTION: main
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=magnet:?xt=urn:btih:69C58E0...

I have tried intent.setType("application/x-bittorrent") with the same result. I do have a couple of applications capable of handling magnet links installed on my test device.

EDIT:

0

There are 0 answers