shareactionprovider

Unable to cast Action Provider to Share Action Provider

走远了吗. 提交于 2019-12-17 07:07:43
问题 Below is the code for my Activity import android.app.Activity; import android.os.Bundle; import android.support.v7.widget.ShareActionProvider; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends Activity { private ShareActionProvider shareAction; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate

Restricting share options

前提是你 提交于 2019-12-13 18:19:30
问题 Is there a way to restrict share options in an Android app? I have tried using the ShareActionProvider or just simply starting an intent using the Intent.ACTION_SEND intent option. Basically I want to be able to restrict sharing through email only or something of the sort. 回答1: you can use something like this, but instead of facebook look for a different name Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(android

How to detect when user selects menu item with ShareActionProvider?

↘锁芯ラ 提交于 2019-12-11 09:41:03
问题 I have small problem with my Android app. I'm creating standard menu (using onCreateOptionsMenu). One of my menu elements is share button. This share element is using OnShareTargetSelectedListener to intercept which of the share options is clicked. The problem is - I need to know if user clicks this "share" menu item (not share sub-element with all the sharing options like "Facebook", "Bluetooth", "Email" etc.). In onMenuItemSelected there is no call when "share" is clicked. Is there any

How to exclude the application itself from Android share (ShareActionProvider)

余生颓废 提交于 2019-12-11 04:48:33
问题 I made a share function in a App called GovDic . But in the share list, the application itself appeared. How to exclude it from the share? I need share text/plain content to other App, also other App can share text/plain content to this App. manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.comp548.govdic"> ... <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app

ShareActionProvider with one icon - looking as simple actionitem

不打扰是莪最后的温柔 提交于 2019-12-10 14:54:58
问题 I want to dislay ShareActionProvider on ActionBar , but with custom look&feel. Only one simple share icon without borders and without most used app icon on the right. But providing popup menu with most used applications. Is there a simple way to do it without implementing own ShareActionProvider ? 回答1: OK so regardless of ActionBarSherlock first test to see if your creating your intent correctly, ABS uses the same code as the generic chooser does so see if the app's you are looking for show

Android: ShareActionProvider with no history

删除回忆录丶 提交于 2019-12-10 02:56:28
问题 According to the Android documentation if I don't want my ShareActionProvider to persist the share history I should call mShareActionProvider.setShareHistoryFileName(null) However when I do this I get the following crash on selecting a share option: 11-15 10:06:34.848: E/AndroidRuntime(22461): java.lang.IllegalStateException: No preceding call to #readHistoricalData 11-15 10:06:34.848: E/AndroidRuntime(22461): at android.widget.ActivityChooserModel.persistHistoricalDataIfNeeded

ShareActionProvider with a split ActionBar

人走茶凉 提交于 2019-12-09 14:10:52
问题 I'm using a ShareActionProvider and would like to take advantage of the split ActionBar when there isn't enough room for it at the top - android:uiOptions="splitActionBarWhenNarrow" . The action works fine when the ActionBar does not need to split: However when the ActionBar does need to split, the ActionProvider seems to break the lower ActionBar layout completely. It fills the entire viewport below the top ActionBar and the action itself does not appear: Has anyone been able to use these

Android ShareActionProvider with popup menu - undesired duplicate list

孤人 提交于 2019-12-06 03:34:50
Okay this is a pretty specific one: My ShareActionProvider is being used on posts in a forum. It works (apart from pesky facebook but I understand that is a well-known issue). However, when I select the share option from my pop-up menu, two lists are drawn, one on top of the other. How can I fix it so only one list is displayed? Edit: At least two other questions exist on SO referring to this problem: I Use ShareActionProvider in PopupMenu, but show two PopupMenu? Call ShareActionProvider from a PopupMenu Here is my code: Menu item in xml <item android:id="@+id/menu_community_overflow_share"

I Use ShareActionProvider in PopupMenu, but show two PopupMenu?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 01:47:12
问题 I use a ShareActionProvider in a PopupMenu, but when I click the share menu item, it shows two PopupMenus on the screen, one covered by the other. And one shows the application icon and name, the other one only shows the application name. It works fine except this problem... How can I fix it? P.S.: please forgive me for my bad expression My code is: PopupMenu popup = new PopupMenu(this, button); popup.getMenuInflater().inflate(R.menu.scrawl_popup_menu, popup.getMenu()); MenuItem overflowItem

Get image uri from picasso?

偶尔善良 提交于 2019-12-04 16:29:16
问题 I have a fairly large list of image URL's that I'm using to load up a ViewPager using Picasso. I need to be able to provide sharing capabilities for these images via an intent (ultimately sharing via ShareActionProvider). From what I've read, Picasso isn't really built to handle this sort of thing out of the box, though it provides all the necessary tools to do so. My plan before research was to create a simple LruCache which uses the url as the key and bitmap value. This caching would occur