Merge pull request #1327 from Somethingweirdhere/dev
Fixed crash when trying to open a downloaded file without a player
This commit is contained in:
commit
a708278cf0
|
@ -19,6 +19,7 @@ import android.webkit.MimeTypeMap;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.PopupMenu;
|
import android.widget.PopupMenu;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.schabi.newpipe.R;
|
import org.schabi.newpipe.R;
|
||||||
|
|
||||||
|
@ -282,7 +283,12 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
|
||||||
}
|
}
|
||||||
//mContext.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
//mContext.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
Log.v(TAG, "Starting intent: " + intent);
|
Log.v(TAG, "Starting intent: " + intent);
|
||||||
mContext.startActivity(intent);
|
if (intent.resolveActivity(mContext.getPackageManager()) != null) {
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
} else {
|
||||||
|
Toast noPlayerToast = Toast.makeText(mContext, R.string.toast_no_player, Toast.LENGTH_LONG);
|
||||||
|
noPlayerToast.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
|
@ -294,6 +294,8 @@
|
||||||
<string name="charset_letters_and_digits">Letters and digits</string>
|
<string name="charset_letters_and_digits">Letters and digits</string>
|
||||||
<string name="charset_most_special_characters">Most special characters</string>
|
<string name="charset_most_special_characters">Most special characters</string>
|
||||||
|
|
||||||
|
<string name="toast_no_player">No player has been found for this file</string>
|
||||||
|
|
||||||
<!-- About -->
|
<!-- About -->
|
||||||
<string name="title_activity_about">About NewPipe</string>
|
<string name="title_activity_about">About NewPipe</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
|
|
Loading…
Reference in New Issue