Hi, I have a big problem with Edit text and notes, when I write text inside them the text isn't saved, I'm using the PDFReader class from the 3.6 version and the premium trial license. the other functionalities works fine.
This is the code
public void onDismiss()
{
Log.d("Reader","onDismiss");
if( m_edit_type == 1 )//edit box
{
EditText edit = (EditText)m_pEdit.getContentView().findViewById(R.id.annot_text);
Log.d("Reader","Text Edit "+edit.getText().toString());//always return the wrote text
m_annot.SetEditText(edit.getText().toString());
Log.d("Reader", "Annot text "+m_annot.GetEditText());//always return null
m_view.vRenderSync(m_annot_page);
if( m_listener != null )
m_listener.OnPageModified(m_annot_page.GetPageNo());
PDFEndAnnot();
}
if( m_edit_type == 2 )//combo
{
if( m_sel_index >= 0 )
{
m_annot.SetComboItem(m_sel_index);
m_view.vRenderSync(m_annot_page);
if( m_listener != null )
m_listener.OnPageModified(m_annot_page.GetPageNo());
}
m_sel_index = -1;
PDFEndAnnot();
}
m_edit_type = 0;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String str_subj = subj.getText().toString();
String str_content = content.getText().toString();
Log.d("Reader","Ok click "+m_annot);
Log.d("Reader","Dialog text "+str_subj+" "+str_content);//always return correct text
if(m_annot!=null) {
m_annot.SetPopupSubject(str_subj);//not saving
m_annot.SetPopupText(str_content);//not saving
}
dialog.dismiss();
m_reader.PDFEndAnnot();
m_set = false;
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
m_reader.PDFEndAnnot();
m_set = false;
}
});
builder.setTitle("Note Content");
builder.setCancelable(false);
builder.setView(layout);