How to obtain the below result.
The background i have an activity but hw can i get the popup view as shown below.
or should i inflate an view and right the whole code there
Hi i have an activity.. on a button click i need to popup a view as below, which will work independently as seperate flow... how can i achieve it.. if possible can i have a sample to get the 1st popup screen so tat i can handle other views.
How can this be achieved, if its fragment hw can i achieve it.
You have to create dialog using AlertDialog.Builder
and then inflate the View
you are showing in the popupwindow and then set the custom view of AlertDialog.Builder
as AlertDialog.Builder builder = new AlertDialog.Builder(this)
builder.setView()
Hope this helps.
您可以创建一个对话框片段并在此处显示,这是android开发人员指南的链接
I have three method to provide to achieve this effect,but I won't give you sample code,I think try by yourself you can learn more and this is why SOF exists,
setView()
for this dialog,and when you want to show it,use dialog.show()
and dialog.dismiss()
to dismiss it. Fragment
to show as the floating view, DialogFragment will be best.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.