When sharing on Android, why do hashtags work with the browser, but not the Twitter app itself? -
i using similar method sharing on twitter like:
this allows users without twitter app open browser , share. however, have noticed hashtags passed message when being shared via browser. if user chooses official app, hash tag disappears. known bug?
thanks!
try so:
sharevia("twitter", "example.com"); .... private void sharevia(string packagename, string content) { string toshare = content; intent shareintent = new intent(android.content.intent.action_send); shareintent.settype("text/plain"); shareintent.putextra(android.content.intent.extra_text, toshare); packagemanager pm = mactivity.getpackagemanager(); list<resolveinfo> activitylist = pm.queryintentactivities(shareintent, 0); (final resolveinfo app : activitylist) { if ((app.activityinfo.packagename).contains(packagename)) { final activityinfo activity = app.activityinfo; final componentname name = new componentname(activity.applicationinfo.packagename, activity.name); shareintent.addcategory(intent.category_launcher); shareintent.setflags(intent.flag_activity_new_task | intent.flag_activity_reset_task_if_needed); shareintent.setcomponent(name); mactivity.startactivity(shareintent); break; } } }
Comments
Post a Comment