Example usage for android.content ClipData newRawUri

List of usage examples for android.content ClipData newRawUri

Introduction

In this page you can find the example usage for android.content ClipData newRawUri.

Prototype

static public ClipData newRawUri(CharSequence label, Uri uri) 

Source Link

Document

Create a new ClipData holding an URI with MIME type ClipDescription#MIMETYPE_TEXT_URILIST .

Usage

From source file:org.hopestarter.wallet.ui.RequestCoinsFragment.java

private void handleCopy() {
    final Uri request = Uri.parse(determineBitcoinRequestStr(false));
    clipboardManager.setPrimaryClip(ClipData.newRawUri("Bitcoin payment request", request));
    log.info("payment request copied to clipboard: {}", request);
    new Toast(activity).toast(R.string.request_coins_clipboard_msg);
}

From source file:org.cm.podd.report.activity.SettingActivity.java

private void captureImageFromCamera() {
    mCurrentPhotoUri = getImageUri();/*from   w  w w  .  j a v a 2s.c o m*/
    Intent photoTakerIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    photoTakerIntent.putExtra(MediaStore.EXTRA_SIZE_LIMIT, 1024 * 1024);
    photoTakerIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    photoTakerIntent.putExtra(MediaStore.EXTRA_OUTPUT, mCurrentPhotoUri);
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
        photoTakerIntent
                .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            photoTakerIntent.setClipData(ClipData.newRawUri("", mCurrentPhotoUri));
        }
    }
    startActivityForResult(photoTakerIntent, REQ_CODE_TAKE_IMAGE);
}

From source file:com.android.browser.BookmarksPageCallbacks.java

private void copy(CharSequence text) {
    ClipboardManager cm = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
    cm.setPrimaryClip(ClipData.newRawUri(null, Uri.parse(text.toString())));
}

From source file:com.borqs.browser.combo.BookmarksPageCallbacks.java

private void copy(CharSequence text) {
    ClipboardManager cm = (ClipboardManager) this.getSystemService(Context.CLIPBOARD_SERVICE);
    cm.setPrimaryClip(ClipData.newRawUri(null, Uri.parse(text.toString())));
}