Mukund
Mukund

Reputation: 1105

What to do to dismiss a dialog box which is coded as a dialog activity?

/*packages and imports*/

public class BookmarkDialoge extends Activity 
{
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bookmarksaver);
}

public void bookmarking(View v)
{
EditText bookmarking=(EditText)findViewById(R.id.bookmarkname);
final String bookMarkname=bookmarking.getText().toString();
String pathdir= getIntent().getExtras().getString("bookpath");
String address=getIntent().getExtras().getString("chapterAddress");
System.out.println("book directory in bookmark class is "+ pathdir);

SQLiteDatabase db;
            db=openOrCreateDatabase("epub.db",SQLiteDatabase.CREATE_IF_NECESSARY,null);
            db.setLocale(Locale.getDefault());
            db.setLockingEnabled(true);
            db.setVersion(1);
    try
    {
        String updateQuery1 = "UPDATE BookMark SET addresname=? WHERE bookdir=? AND lastaddress=?";
                    db.execSQL(updateQuery1, new String[] { bookMarkname, pathdir,address });
                    System.out.println("Bookmark table updated with name");   
    }

    catch(Exception e)
    {
        System.out.println(e);
        }
        finally
        {
        db.close();
        }


}

}

and in manifest i have given this activity as

<activity android:theme="@android:style/Theme.Holo.Dialog" >

sothat it appears as a dialoge

This is my class everything works well, but i need to dismiss the dialogebox after clicking the button, means it should just disappear, (it came as a popup box) what should i do? please help

Upvotes: 0

Views: 42

Answers (1)

M D
M D

Reputation: 47807

You just finish() the Activity in close button onClick() event

Upvotes: 1

Related Questions