Back to project page HistoryCleanerPro.
The source code is released under:
Copyright (c) 2014, John Phillips All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
If you think the Android project HistoryCleanerPro listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ayros.historycleaner.cleaning.items; // ww w . jav a2 s . c om import java.util.ArrayList; import java.util.List; import android.content.Context; import android.graphics.drawable.Drawable; import android.text.ClipboardManager; import com.ayros.historycleaner.Globals; import com.ayros.historycleaner.R; import com.ayros.historycleaner.cleaning.Category; import com.ayros.historycleaner.cleaning.CleanItem; @SuppressWarnings("deprecation") public class _System_Clipboard extends CleanItem { public _System_Clipboard(Category parent) { super(parent); } @Override public String getDisplayName() { return "Clipboard"; } @Override public Drawable getIcon() { return Globals.getContext().getResources().getDrawable(R.drawable.system_clipboard); } @Override public boolean isApplicable() { return true; } @Override public boolean runOnUIThread() { return true; } @Override public boolean isRootRequired() { return false; } @Override public List<String []> getSavedData() { ClipboardManager clipboard = (ClipboardManager)Globals.getContext().getSystemService(Context.CLIPBOARD_SERVICE); CharSequence clip = clipboard.getText(); if (clip == null) { List<String []> ret = new ArrayList<String []>(); ret.add(new String[] { }); ret.add(new String[] { "No text on clipboard." }); return ret; } else { List<String []> ret = new ArrayList<String []>(); ret.add(new String[] { }); ret.add(new String[] { "Clipboard text: " + clip }); return ret; } } @Override public boolean clean() { ClipboardManager clipboard = (ClipboardManager)Globals.getContext().getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setText(null); return true; } }