3

我有围绕图像流动的flowtextview。我想在长按时选择文本..我怎样才能为流文本视图做到这一点..到目前为止我所做的是

txtDesc = (FlowTextView) findViewById(R.id.tDescription);
txtDesc.setText(temp_desc);
CharSequence stringYouExtracted = text.getText();
int startIndex = text.getSelectionStart();
int endIndex = text.getSelectionEnd();
stringYouExtracted = ( stringYouExtracted).subSequence(startIndex, endIndex);
getSystemService(CLIPBOARD_SERVICE);
if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.ECLAIR) 
{
   android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
    clipboard.setText(stringYouExtracted);
} else {
    ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
  System.err.println("clipboard to select"+clipboard);
}
4

0 回答 0