File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/local/subscription Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import android.view.MenuItem
1313import android.view.SubMenu
1414import android.view.View
1515import android.view.ViewGroup
16+ import android.webkit.MimeTypeMap
1617import android.widget.Toast
1718import androidx.activity.result.ActivityResult
1819import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
@@ -460,6 +461,14 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
460461 }
461462
462463 companion object {
463- const val JSON_MIME_TYPE = " application/json"
464+ val JSON_MIME_TYPE = getMimeType()
465+
466+ private fun getMimeType (): String {
467+ val mimeTypeJson = MimeTypeMap .getSingleton().getMimeTypeFromExtension(" json" )
468+ return if (mimeTypeJson.isNullOrBlank())
469+ " application/octet-stream"
470+ else
471+ mimeTypeJson
472+ }
464473 }
465474}
You can’t perform that action at this time.
0 commit comments