Android 将Activiyt作为Dialog弹出
在Androidmanifest.xml中加入如下主题
<activity android:name="com.example.mymeidaplay.Player"
android:theme="@android:style/Theme.Dialog" >
</activity> |
在作为Dialog的Activity中做如下设置:
@Overridepublic void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} |
效果图:
黑色部分就是一个Dialog。
本文转自Work Hard Work Smart博客园博客,原文链接:http://www.cnblogs.com/linlf03/archive/2013/06/13/3134303.html,如需转载请自行联系原作者