Add subject to shared URL's (fixes #975)

This commit is contained in:
Coffeemakr
2018-01-09 12:41:30 +01:00
parent 33d75fd2fb
commit b93d94b0bd
4 changed files with 6 additions and 9 deletions
@@ -19,6 +19,7 @@ import org.schabi.newpipe.MainActivity;
import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.ExtractorHelper;
@@ -252,9 +253,10 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
startActivity(intent);
}
protected void shareUrl(String url) {
protected void shareUrl(String subject, String url) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, url);
startActivity(Intent.createChooser(intent, getString(R.string.share_dialog_title)));
}