Back to project page retain-android.
The source code is released under:
GNU General Public License
If you think the Android project retain-android 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.retain2.dialog; //w w w . j a v a 2s .com import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.widget.EditText; import com.retain2.R; import com.retain2.PageInfo; import com.retain2.WebDbAdapter; import com.retain2.RenameHandlerInterface.OnRenameItemListener; public class RenameDialog extends AlertDialog { private EditText mET; private WebDbAdapter mDbAdapter; private OnRenameItemListener mRenameListener; private PageInfo mPageInfo; public RenameDialog(Activity activity, PageInfo pageInfo, WebDbAdapter dbAdapter, OnRenameItemListener renameListener) { super(activity); mET = new EditText( activity ); mET.setText( pageInfo.getTitle() ); mDbAdapter = dbAdapter; mPageInfo = pageInfo; mRenameListener = renameListener; setView( mET ); setCancelable(true); setTitle(activity.getString(R.string.web_rename)); setButton( activity.getString(R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String title = mET.getText().toString(); mPageInfo.setTitle( title ); mRenameListener.onRenameItem(title); return; } }); setButton2(activity.getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); } }