mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Added share option to Popup and Background queues
This commit is contained in:
		| @@ -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 | ||||
|     //////////////////////////////////////////////////////////////////////////// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Somethingweirdhere
					Somethingweirdhere