shareactionprovider

Size of ShareAction icon issue on ActionBar with ShareActionProvider-v7

北战南征 提交于 2019-11-30 23:23:50
问题 I was working around my old ShareAction on my ActionBar and it was working since I updated my Packages on SDK Manager . I saw this doc from Google which says, To add a "share" action to your activity, put a ShareActionProvider in the app bar's menu resource. For example: And I've added the same without adding any Icons : <item android:id="@+id/action_share" android:title="@string/share" app:showAsAction="ifRoom" app:actionProviderClass="android.support.v7.widget.ShareActionProvider"/> I was

Null Pointer exception in using support library share action provider

蹲街弑〆低调 提交于 2019-11-30 17:38:05
Below is the code of my Activity . In this I am using the support library appcompat import android.content.Intent; import android.os.Bundle; import android.support.v4.view.MenuItemCompat; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.ShareActionProvider; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) {

Setting a custom share icon on Actionbar ShareActionProvider

有些话、适合烂在心里 提交于 2019-11-30 11:39:59
I'm trying to set the icon ShareActionProvider, need a solid white one instead of the semi transparent white one. However setting in share_menu.xml and code doesn't work. Just wondering whether anyone has got workaround for this before extending the ShareActionProvider. (I'm using actionbarsherlock) @Override public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { inflater.inflate(R.menu.share_menu, menu); MenuItem actionItem = menu.findItem(R.id.share_action_provider); ShareActionProvider actionProvider = (ShareActionProvider) actionItem.getActionProvider();

Setting a custom share icon on Actionbar ShareActionProvider

孤者浪人 提交于 2019-11-29 17:07:15
问题 I'm trying to set the icon ShareActionProvider, need a solid white one instead of the semi transparent white one. However setting in share_menu.xml and code doesn't work. Just wondering whether anyone has got workaround for this before extending the ShareActionProvider. (I'm using actionbarsherlock) @Override public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { inflater.inflate(R.menu.share_menu, menu); MenuItem actionItem = menu.findItem(R.id.share_action_provider)

How to hide the share action (which use most) icon near the share action provider?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 04:33:26
See the picture. How can i hide the icon "P" which means share to Pinterest? They are both on the action bar and I use ActionBarSherlock. Sean If you wish to keep all the share history data model , but just don't want the extra "default share activity" icom. The answer at How do you turn off share history when using ShareActionProvider? is not good enough. What you should do is: Copy these classes from the ActionBarSherlock to your project code ShareActionProvider.java ActivityChooserView.java At your ShareActionProvider.java class, import the ActivityChooserView.java which you just copied

Unable to cast Action Provider to Share Action Provider

若如初见. 提交于 2019-11-27 03:02:48
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 the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity

Share image and text through whatsapp

╄→гoц情女王★ 提交于 2019-11-26 21:53:18
问题 I use the following code to share an image and text through WhatsApp. It only shares the image, not the text, however. I have searched all over the Internet, but haven't found a solution. String message = Fname + Mobileno + Homeno + Workmail + Homemail + Gtalk + Skype + Address + Company + Title + Website; Intent shareIntent = new Intent(Intent.ACTION_SEND); Uri uri = Uri.parse("file://" + Environment.getExternalStorageDirectory() + "/Talk&Share/Images/profpic.png"); shareIntent.putExtra

How do you turn off share history when using ShareActionProvider?

删除回忆录丶 提交于 2019-11-26 16:02:03
问题 The new ShareActionProvider available in Android 4.0 (or in earlier versions if you're using ActionBarSherlock) has a feature where the last used item is displayed in the action bar. Is there anyway to turn this off? 回答1: There is no API to do this. However, the class is really simple and you could very easily create your own version of ShareActionProvider that did not keep a history. You would just have to determine the sort order of the possible targets using some other means of ordering (e