Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Passing views to a second fragment screen does not display them correctly

Passing views to a second fragment screen does not display them correctly

Scheduled Pinned Locked Moved Android
wpfwcfcomdata-structuresdebugging
2 Posts 2 Posters 14 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lixo ten
    wrote on last edited by
    #1

    I am getting an an error when I try to display 2 input views. They are captured in one fragment screen and then I try to display them on a second fragment screen. The navigation works but they display as resources?... i do not even know what it is called. This is the setOnClickListener that calls up that screen. I suspect it has something to go with safeArgs

    binding.buttonConfirm.setOnClickListener{
    val username = binding.editTextUsername.toString()
    val password = binding.editTextPassword.toString()
    val action = LoginFragmentDirections.actionLoginFragmentToWelcomeFragment(username, password) findNavController().navigate(action)
    }

    Screenshot with error Screenshot of debugger watches

    W 1 Reply Last reply
    0
    • L lixo ten

      I am getting an an error when I try to display 2 input views. They are captured in one fragment screen and then I try to display them on a second fragment screen. The navigation works but they display as resources?... i do not even know what it is called. This is the setOnClickListener that calls up that screen. I suspect it has something to go with safeArgs

      binding.buttonConfirm.setOnClickListener{
      val username = binding.editTextUsername.toString()
      val password = binding.editTextPassword.toString()
      val action = LoginFragmentDirections.actionLoginFragmentToWelcomeFragment(username, password) findNavController().navigate(action)
      }

      Screenshot with error Screenshot of debugger watches

      W Offline
      W Offline
      wseng
      wrote on last edited by
      #2

      You need to get the text value from editText

      val username = binding.editTextUsername.text.toString()

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups