title: Passing data from Activity to Fragment using Safe Args
body: <p>I have recently started looking into a bit more advanced Android development due to my needs.
  Starting with Navigation Component, I learned about a way to work with Fragments as well as possibility of passing data with SafeArgs</p>
  
  <p>While I am able to understand and find information on how to pass data between different fragments, I am not finding any information on how to pass data from the actual Activity to the fragment.</p>
  
  <p>Here is a short description of when I would need this:</p>
  
  <p>&lt;- Login Screen -> (Main activity) - NO FRAGMENTS, SIMPLE LOG-IN ACTIVITY</p>
  
  <p>-- <em>user enters data</em></p>
  
  <p>-- <em>clicks Log-in</em></p>
  
  <p>-- <em>Login successful</em></p>
  
  <p>-- <em>Saving and sending HTTP response data with other necessary information and transfering to Profile Page</em></p>
  
  <p>&lt;- Profile Page -> (ProfilePage Activity) with Drawer Layout that uses NavHostFragment to display different Fragments: [Profile Page], [Contact Info], [Payment Cards]</p>
  
  <p>-- <em>Profile Page Fragment</em></p>
  
  <p>-- <em>Extract data sent by Main Acitivity and use it to change values of ProfilePage Fragment TextViews</em></p>
  
  <p>Here is where I face my problem - I have no idea how to pass data from the actual Activity to Fragment, especially when I know that there are so called SafeArgs that I only have a vague undestanding of.</p>
  
  <p>Can someone please help me understand this better or at least point me in the right direction?</p>