i have done that but when we play tech it works but show toast "add annotation failed!".
I have done this in OnPDFSelectEnd method
if( rad_group.getCheckedRadioButtonId() == R.id.rad_copy )
{
// Toast.makeText(PDFViewAct.this, "todo copy text:" + sel_text, Toast.LENGTH_SHORT).show();
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("RACHNA SAGAR", sel_text);
clipboard.setPrimaryClip(clip);
}
else if( m_doc.CanSave() )
{
boolean ret = false;
if( rad_group.getCheckedRadioButtonId() == R.id.rad_copy )
{
// Toast.makeText(PDFViewAct.this, "todo copy text:" + sel_text, Toast.LENGTH_SHORT).show();
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("RACHNA SAGAR", sel_text);
clipboard.setPrimaryClip(clip);
}
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_highlight )
ret = m_view.PDFSetSelMarkup(0);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_underline )
ret = m_view.PDFSetSelMarkup(1);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_strikeout )
ret = m_view.PDFSetSelMarkup(2);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_squiggly )
ret = m_view.PDFSetSelMarkup(4);
else if( rad_group.getCheckedRadioButtonId() == R.id.rad_Text_to_Speech )
{
txtText=sel_text;
speakOut();
}
if( !ret )
Toast.makeText(PDFViewAct.this, "add annotation failed!", Toast.LENGTH_SHORT).show();
}
else
Toast.makeText(PDFViewAct.this, "can't write or encrypted!", Toast.LENGTH_SHORT).show();