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

ShareUtil.java « util « 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: 1a1f6f37521ba51822807fdfc1aa566e92f709d1 (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.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));
    }
}