Dialog with ActionBar's



  • Hello! Starting the second activate in a standard way:

    public void showCalendarActivity()
    {
        Intent intentTask = new Intent(this, CalendarActivity.class);
        startActivityForResult(intentTask, 1);
    }
    

    and receive:

    введите сюда описание изображения

    If I start a second activate as Dialog:

    public void showCalendarActivity()
    {
        Dialog dialog = new Dialog(this);
        dialog.setContentView(R.layout.activity_calendar);
        dialog.show();
    }
    

    Received:

    введите сюда описание изображения

    Is there a way to get this:

    введите сюда описание изображения

    I mean. Dialog, but with ActionBar's top?

    UPDATE

    Using the advice, added Toolbar and in the manifested style. android:theme="@style/Theme.AppCompat.Dialog"♪ Calling the first way that the usual activate is:

    Intent intentTask = new Intent(this, CalendarActivity.class);
    startActivityForResult(intentTask, 1);
    

    Something similar to the desired result:

    введите сюда описание изображения

    But somehow the calendar became "transparent." How do we eliminate this problem? And how do we remove the title from the Tulbar? The title is not given in the layout. And how do we focus on the top?

    введите сюда описание изображения

    To that effect:

    введите сюда описание изображения

    It's even better to get the top script off, too.



  • In order for your Assytities to be displayed as a dialogue in the manifesto file, set the following theme:

    <activity android:theme="@android:style/Theme.Dialog" />
    

    Either, using support library:

     <activity android:theme="@style/Theme.AppCompat.Dialog"/>
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2