- Posts: 69
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
How to add dictionary on word search ?
- rachnasagar
- Topic Author
- Offline
- Senior Member
-
Less
More
9 years 3 weeks ago - 9 years 3 weeks ago #12019
by rachnasagar
Replied by rachnasagar on topic How to add dictionary on word search ?
I want to add button in popup where highlighter underline is howing .
And on click there my text to speech will open and start working .
So I jut want to add feature in that popup and on click there my method will start work?
And on click there my text to speech will open and start working .
So I jut want to add feature in that popup and on click there my method will start work?
Last edit: 9 years 3 weeks ago by rachnasagar.
- rachnasagar
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 69
- Thank you received: 0
9 years 3 weeks ago #12021
by rachnasagar
Replied by rachnasagar on topic How to add dictionary on word search ?
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();
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();
9 years 3 weeks ago - 9 years 3 weeks ago #12022
by nermeen
Replied by nermeen on topic How to add dictionary on word search ?
You see the toast, because ret is not set in case of TTS (text to speech).
To solve this, you can:
To solve this, you can:
- Initialize ret with true:
Code:boolean ret = true;
- OR set ret = true; inside:
Code:else if( rad_group.getCheckedRadioButtonId() == R.id.rad_Text_to_Speech ) { ret = true; txtText=sel_text; speakOut(); }
Last edit: 9 years 3 weeks ago by nermeen.
Time to create page: 0.352 seconds