Android Open Source - action-send-gridview Send To Clipboard






From Project

Back to project page action-send-gridview.

License

The source code is released under:

Apache License

If you think the Android project action-send-gridview listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.urbancups.actionsendgridview;
/*w w w. j  a  va  2  s. co  m*/
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.Toast;

/**
 * Created by CUPS on 06/09/2014
 */
public class SendToClipboard extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //get the application context
        Context context = this.getApplicationContext();

        //setup the clipboard manager
        final android.content.ClipboardManager clipboardManager = (android.content.ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);

        //setup the clipboard data
        final android.content.ClipData clipData = android.content.ClipData
                .newPlainText("CUPS clipboard data", getIntent().getStringExtra("CupsText"));

        //make it the last item in clipboard data
        clipboardManager.setPrimaryClip(clipData);

        // alert the user that the text is in the clipboard and we're done
        Toast.makeText(this, R.string.sendtoclipboard_textcopied, Toast.LENGTH_SHORT).show();

        finish();
    }
}




Java Source Code List

com.urbancups.actionsendgridview.GridAdapter.java
com.urbancups.actionsendgridview.GridviewFragment.java
com.urbancups.actionsendgridview.IntentShare.java
com.urbancups.actionsendgridview.SendToClipboard.java
com.urbancups.actionsendgridview.example.MainActivity.java