android-sharing

sharing image from drawable

青春壹個敷衍的年華 提交于 2019-12-08 13:14:57
问题 I want create activity for share image from drawable source, and this is my code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { Uri imageUri = Uri.parse("android.resource://com.androidbegin.shareimagetutorial/drawable"+R.drawable.ic_launcher); Intent intent = new Intent(Intent.ACTION

How to share image from link ,i.e, without downloading the image just share using a button

对着背影说爱祢 提交于 2019-12-08 01:26:25
问题 I am beginner in android studio and i think it will be easy but also I am not getting that How to share image from link ,i.e, without downloading the image just share on social media like whats app .I can download the image and then share and then delete that but I do not want to do that. I am using glide library to load the image in Image view and then when a user click on a button it will just share its image which is showing in image view and whose link i have and then come back to the app

How to share image from link ,i.e, without downloading the image just share using a button

荒凉一梦 提交于 2019-12-06 15:42:36
I am beginner in android studio and i think it will be easy but also I am not getting that How to share image from link ,i.e, without downloading the image just share on social media like whats app .I can download the image and then share and then delete that but I do not want to do that. I am using glide library to load the image in Image view and then when a user click on a button it will just share its image which is showing in image view and whose link i have and then come back to the app. I am using Glide library for loading image. Any help will be grateful. Thanks in advance. first you

How to share image to social media with bitmap?

依然范特西╮ 提交于 2019-12-06 09:07:34
I need to share an image from my RecyclerAdapter because the image does not initially exist, i.e. is loaded within the Activity making use of the adapter. How can I share the bitmap to social media? Every time I click share in my app it says "No apps can perform this action". feedItemView.setFeedSocialShareClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Share to Social Media ImageView imageView = (ImageView) feedItemView.findViewById(R.id.image); Drawable mDrawable = imageView.getDrawable(); Bitmap mBitmap = ((BitmapDrawable)mDrawable).getBitmap(); String

How to share *.txt file in android

徘徊边缘 提交于 2019-12-06 04:25:56
问题 I tried many ways but i can't do this . I have a *.txt file . i want share it via Bluetooth , wifi , email and ... . When i used this code i cant share the file: File file = new File(Environment.getExternalStorageDirectory(), "Email-Ghap/Emails.txt"); Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("*/txt"); sharingIntent.putExtra(Intent.EXTRA_STREAM, file); startActivity(Intent.createChooser(sharingIntent, "share file with")); Totally i want this : when user

Android sharing image doesn't work

馋奶兔 提交于 2019-12-05 06:47:24
I am trying to share a screenshot of the application using the following code: View content = findViewById(R.id.layoutHome); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File sdCardDirectory = Environment.getExternalStorageDirectory(); File image = new File(sdCardDirectory,"temp.png"); // Encode the file as a PNG image. FileOutputStream outStream; try { outStream = new FileOutputStream(image); bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream); outStream.flush(); outStream.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch

Specifying a SEND (sharing) intent filter for a Service

血红的双手。 提交于 2019-12-05 03:52:28
I am trying to filter and handle intents with android.intent.action.SEND actions in one of my Service s. I wrote the following in my AndroidManifest.xml : <service android:name=".app.ScreamerService" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.SEND"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="*/*"/> </intent-filter> </service> Now, the problem is that I don't see my application in the list of "share via" options when, for instance, trying to share a web page from the browser or a contact from the list

How to share *.txt file in android

主宰稳场 提交于 2019-12-04 08:29:31
I tried many ways but i can't do this . I have a *.txt file . i want share it via Bluetooth , wifi , email and ... . When i used this code i cant share the file: File file = new File(Environment.getExternalStorageDirectory(), "Email-Ghap/Emails.txt"); Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("*/txt"); sharingIntent.putExtra(Intent.EXTRA_STREAM, file); startActivity(Intent.createChooser(sharingIntent, "share file with")); Totally i want this : when user clicked on share button and choose one email sender like Gmail for sharing . the file must be attached file

How to add .apk file inside intent

扶醉桌前 提交于 2019-12-03 20:08:36
I want to add .apk file inside intent. I want to create a button "Share" which will share the whole app through bluetooth or any other application which have capability to send application. If this can be done by other way then please tell me! Thanks List(ApplicationInfo) mAppList=getPackageManager().getInstalledApplications(0); ApplicationInfo item = mAppList.get(position); public static void ShareAPK(ApplicationInfo item,Context ctx) { try { File srcFile = new File(item.publicSourceDir); Intent share = new Intent(); share.setAction(Intent.ACTION_SEND); share.setType("application/vnd.android

Share Intent of Google+ can not access image

戏子无情 提交于 2019-12-03 05:59:19
问题 i am calling an intent to share an image. this works with most providers, BUT with Google+. Google+ opens the post activity without the image and displays the toast "You can only post photos stored on your device." at the same time. File f = storeImage(image); // f = /data/data/com.myapp/files/1333070776978.jpg Uri uri = Uri.fromFile(f); Intent share = new Intent(Intent.ACTION_SEND); share.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); share.setType("image/jpeg"); share.putExtra(Intent