GithubHelp home page GithubHelp logo

Comments (1)

 avatar commented on July 26, 2024

This is how to do it:

Get current time & date:
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); String currentDateandTime = sdf.format(new Date());
https://stackoverflow.com/questions/5369682/get-current-time-and-date-on-android

Copy text to system clipboard:
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText(label, text); clipboard.setPrimaryClip(clip);
https://stackoverflow.com/questions/19253786/how-to-copy-text-to-clip-board-in-android

Paste text from systme clipboard:
private void onPaste(){ Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable t = c.getContents(this); if (t == null) return; try { jtxtfield.setText((String) t.getTransferData(DataFlavor.stringFlavor)); } catch (Exception e){ e.printStackTrace(); }//try }//onPaste
https://stackoverflow.com/questions/6631933/how-would-i-make-a-paste-from-java-using-the-system-clipboard#16694596

from snotepad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.