android - How to share picture from Photo Gallery to my application? -


i have application written in titanium. , on android device, in photo gallery, click share via. picture can share via gmail, message, goolge+, ... want add 1 more option picture can share via application. there have solution process?

thanks.

you need add intent filter intercept correct intant.action_send shown here:

 <intent-filter>      <action android:name="android.intent.action.send" />      <category android:name="android.intent.category.default" />      <data android:mimetype="image/*" />  </intent-filter>   var win = ti.ui.createwindow({      backgroundcolor: '#fff',      fullscreen: false,      exitonclose: true  });  win.addeventlistener('open', function(e) {      var intent = ti.android.currentactivity.getintent();      var iname = ti.android.extra_stream;      if (intent && intent.hasextra(iname)) {          // create imageview tiblob          var blob = intent.getblobextra(iname);          win.add(ti.ui.createimageview({              image: blob,              height: 300,              width: 300,              left: 0,              top: 0          }));      } else {          ti.api.info('no named "' + iname + '" found in intent');      }  });          win.open(); 

Comments