Ex:
AndroidManifest.xml:
<activity
android:theme="@android:style/Theme.Holo.Light.Dialog.MinWidth"android:name=".DialogActivity" />
Different Dialog styles are:
- android:theme="@android:style/Theme.Dialog"
- android:theme="@android:style/Theme.Holo.Dialog"
- android:theme="@android:style/Theme.Holo.Dialog.MinWidth"
- android:theme="@android:style/Theme.Holo.Dialog.NoActionBar"
- android:theme="@android:style/Theme.Holo.Dialog.NoActionBar.MinWidth"
- android:theme="@android:style/Theme.Holo.DialogWhenLarge"
- android:theme="@android:style/Theme.Holo.DialogWhenLarge.NoActionBar"
- android:theme="@android:style/Theme.Holo.Light.Dialog"
- android:theme="@android:style/Theme.Holo.Light.Dialog.MinWidth"
- android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar"
- android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar.MinWidth"
- android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge"
- android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar"
DialogActivity.java:
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(new ColorDrawable(0));
setContentView(R.layout.main);
}
-------------------------------------
OR:
Dialog:
final Dialog dialog = new Dialog(this, android.R.style.Theme_Holo_Light_Dialog_MinWidth);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
dialog.setContentView(R.layout.main);
dialog.setCancelable(true);
dialog.show();
Have you notice of some delay in between your splash to disappear and your main activity appears just for this line i the manifest? android:theme="@android:style/Theme.Holo.Dialog.NoActionBar"
ReplyDelete