开发者

How to start an activity Dialog

开发者 https://www.devze.com 2023-02-03 02:52 出处:网络
I have one activity which i am using for displaying Dialogs and as a normal layout. So what i want to do is, sometimes i want to start activity as Th开发者_开发百科eme Dialog and some times using setC

I have one activity which i am using for displaying Dialogs and as a normal layout.

So what i want to do is, sometimes i want to start activity as Th开发者_开发百科eme Dialog and some times using setContentView.

I can't use <activity android:theme="@android:style/Theme.Dialog"> in manifest file as it will always display activity as dialog.

So can we do it programmatic, i have also tried setTheme() method but it did't work.

Thanks,

PP.


If you know the dialog/fullscreen style before starting the activity, you could add 2 subclasses and declare them in your manifest. Then you start one or the other depending on the desired style.

0

精彩评论

暂无评论...
验证码 换一张
取 消