Android Code Snippet Simplest custom dialog box

Discussion in 'Code Snippets' started by HAH, Feb 14, 2019.

  1. HAH

    HAH Active Member Licensed User

    The simplest way to make a custom dialog with your any idea design is to design a new activity as you want and convert it to dialog by adding the following line to manifest file:
    Code:
    SetActivityAttribute(ACTIVITYNAME,android:theme,@android:style/Theme.Dialog)
    Make sure to replace the ACTIVITYNAME to yours.
    Then call this dialog as:
    Code:
    startactivity(ACTIVITYNAME )
     
    Last edited: Feb 14, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

    HAH likes this.
  3. HAH

    HAH Active Member Licensed User

    Holo removed
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Theme.Dialog is actually worst. It is Android 2 theme.
     
  5. HAH

    HAH Active Member Licensed User

    so what is the best! AppCompat ? or what?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Don't use an activity as a dialog.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice