Android 将Activiyt作为Dialog弹出
在Androidmanifest.xml中加入如下主题
<activity
android:name="com.example.mymeidaplay.Player"
android:theme="@android:style/Theme.Dialog" >
</activity>
在作为Dialog的Activity中做如下设置:
@Override
public 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/
欢迎任何形式的转载,未经作者同意,请保留此段声明!
浙公网安备 33010602011771号