How to create custom alert dialog in android?

前端 未结 9 1207
再見小時候
再見小時候 2020-12-09 10:36

I am developing a sample app.I am able to show alert on button click having some tittle and button .But now I want to show a pop up window having username (Label)

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 11:03

    its working for me

    Dialog m_dialog; 
    m_dialog = new Dialog(BusinessDetail.this);
                m_dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                
                LayoutInflater m_inflater = LayoutInflater.from(BusinessDetail.this);
                View m_view = m_inflater.inflate(R.layout.rateus_popup, null);
                myPopLay = (LinearLayout) m_view.findViewById(R.id.myPopLay);
    m_dialog.setContentView(m_view);
                m_dialog.show();
    

提交回复
热议问题