Skip to content

Build an Android App with Views #33

@hogansung

Description

@hogansung

In case someone encounters an error of "Preview Unavailable" when visualizing the EntryDialogFragment component in the design mode of nav_graph.xml, one needs to add tools:layout="@layout/fragment_entry_dialog" to the dialog component of entryDialogFragment.

To be more precise, the full code for that entryDialogFragment in the nav_graph.xml should be the following.

<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    // ...
    <dialog
        android:id="@+id/entryDialogFragment"
        android:name="com.example.juicetracker.EntryDialogFragment"
        android:label="EntryDialogFragment"
        tools:layout="@layout/fragment_entry_dialog" >    <!-- This line is critical. -->
    </dialog>
</navigation>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions