3

When we click a share button, a universal "Share Target" pane slides up. Apps declare Share Targets, which is a way that the user can share something from one app to another. This is how, say, we can share a tweet on facebook. It gets even more complex now that share targets can be created for specific contacts. So we can directly share an item with a specific person, through a specific app.

In the developer docs, you can read about how developers can implement certain features to try to increase the "ranking" of their share targets. Basically, they want to get their share buttons closer to the front than share targets from other apps. You can also directly rank the share targets within your own app. Android has some sort of algorithm that dynamically determines the rank of share targets between apps, and this ranking changes with the user's behavior.

What I want to do, however, is outside of the scope of that documentation. I want to "pin" a certain share target, so that is always the very first share target displayed regardless how much I use it. And I only want to do this on my device, so I am not trying in anyway to get around android's ranking system to improve the ranking of my app on other people's devices.

It just so happens the app whose share target I want to "pin" in one I am developing myself, but I suppose such a feature to manually control the ranking of share targets on your own device could be useful regardless whether or not you are developing your own app.

3
  • Welcome to Android Enthusiasts. Just a heads-up that app development is off-topic since Android Enthusiasts focuses on end-users and power users (who are not necessarily developers) solving their issues. Thus, while this community might explain the technicality of Android OS to your queries or provide solutions as end-users, coding solutions are out of the scope of this community.
    – Andrew T.
    Apr 30 at 7:53
  • Hi Andrew. I think my question is a user-oriented question. As I said in my question, it just so happens that my app is one I develop myself. However, I only stated that to provide potentially helpful context. The question itself applies to any app, regardless if I developed it myself or not. The question would not belong in Stack Overflow since I am not asking something related to programming.
    – Matt Groth
    Apr 30 at 22:28
  • Understood, no worries. It's just that sometimes askers have wrong expectations about Android.SE being suitable for Android programming issues.
    – Andrew T.
    May 1 at 3:25

1 Answer 1

0

In Android 14 (and maybe earlier), you can do that:

  1. Long-press the share target (contact or app)
  2. Tap "Pin"

At least I get that on a Pixel 7 phone.

2
  • I have a Samsung Galaxy with Android 13. I just checked, and pinning as you described didn't work.
    – Matt Groth
    Sep 29 at 0:04
  • I tried to update to 14 and it said "No update is available". I am not sure if my phone is no longer eligible for updates, or if it is just one of those times where Samsung Galaxy is getting the update later. I have a Galaxy Note20 Ultra 5G
    – Matt Groth
    Sep 29 at 0:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .