Wednesday, 22 October 2014

How to show Android Activity as a dialog in Android

we can apply a dialog theme to an activity so that it is displayed as a floating dialog.

To apply a dialog theme to an activity, just modify the <Activity> element in the AndroidManifest.xml file by adding the android:theme attribute(android:theme="@android:style/Theme.Dialog") to the Activity.


 In Manifest file just add one simple attribute to show activity as a dialog.

 <activity
android:label="@string/app_name"
android:name=".Activity"
android:theme="@android:style/Theme.Dialog"  />

Then here we got one doubt how to close this activity dialog? 

solution is just call finish( ) method to close the activity dialog.









No comments:

Post a Comment

Android SQLite Database Viewer or Debuging with Stetho

Every Android Developer uses SQLite Database to store data into the Android Application data. But to view the data in SQLite have a lot of...