Skip to content

Opening the Inbox Fragment using NavGraph, not using passed in Arguments #710

@wlynnlt

Description

@wlynnlt

using this code for the navgraph

<fragment
    android:id="@+id/inboxFragment"
    android:name="com.iterable.iterableapi.ui.inbox.IterableInboxMessageFragment"
    android:label="Inbox">

    <argument
        android:name="noMessagesTitle"
        app:argType="string" />

    <argument
        android:name="noMessagesBody"
        app:argType="string" />

</fragment>

and launching the inbox like this
inboxFragment(noMessagesBody = "no messages", noMessagesTitle = "no title body"))

The arguments are not used by the fragment.
But using the arguments like

 var bundle = Bundle()
    bundle.putString(IterableConstants.NO_MESSAGES_TITLE,"No saved messages")
    bundle.putString(IterableConstants.NO_MESSAGES_BODY, "Check again later!")
    val fragment: Fragment = instantiate(  requireContext()  , IterableInboxFragment::class.java.name, bundle)
    
    The fragment is opened and the custom text is rendered.
    Please let me know if I am using the navGraph code wrong.

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