android development: how does my intent / icon get added to user's list like other social media in Android -


i allow users highlight text , post web site. there way create android intent running service show on social media / share list appears in android system?

you know, when user selects picture , 3 dotted share icon appears , gives list? how can application's intent , icon added list twitter, fb etc. ones show up?

to receive data external application in application vis share functionality, need create activity in application accept incoming data. add following details in androidmanifest.xml activity accept data:

<activity android:name=".ui.myactivity" >     <intent-filter>         <action android:name="android.intent.action.send" />         <category android:name="android.intent.category.default" />         <data android:mimetype="image/*" />     </intent-filter> </activity> 

so , if application, shares single image, application visible in list, , if user selects application, ui.myactivity activity launched. can change or add multiple mimetype per requirement.

also, can add/change action multiple_send receive multiple shared files.

once done, in oncreate() method of activity, can fetch data in following manner:

void oncreate (bundle savedinstancestate) {     ...      // intent, action , mime type     intent intent = getintent();     string action = intent.getaction();     string type = intent.gettype();      //play data, per need     ... } 

you can more details regarding this, in official documentation


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -