Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ShareUtil.java « util « shared « notes « owncloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 09ad7124b11ecf352f2a1066a5751a92cdbe891f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package it.niedermann.owncloud.notes.shared.util;

import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN;

public class ShareUtil {
    public static void openShareDialog(@NonNull Context context, @Nullable String subject, @Nullable String text) {
        context.startActivity(Intent.createChooser(new Intent()
                .setAction(Intent.ACTION_SEND)
                .setType(MIMETYPE_TEXT_PLAIN)
                .putExtra(Intent.EXTRA_SUBJECT, subject)
                .putExtra(Intent.EXTRA_TITLE, subject)
                .putExtra(Intent.EXTRA_TEXT, text), subject));
    }
}