Added share option to Popup and Background queues
This commit is contained in:
parent
baa63249d1
commit
201f7e9848
|
@ -340,6 +340,13 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
|||
return true;
|
||||
});
|
||||
|
||||
final MenuItem share = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, /*pos=*/3,
|
||||
Menu.NONE, R.string.share);
|
||||
share.setOnMenuItemClickListener(menuItem -> {
|
||||
shareUrl(item.getTitle(), item.getUrl());
|
||||
return true;
|
||||
});
|
||||
|
||||
menu.show();
|
||||
}
|
||||
|
||||
|
@ -509,6 +516,18 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
|||
.show(getSupportFragmentManager(), getTag());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Share
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private 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)));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Binding Service Listener
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue