orhan berkil
orhan berkil

Reputation: 1

Clicking button doesn't switch pages in Android

Code:

class ProfileFragment : Fragment() {
    
        lateinit var ProfileSetting : ImageView

        override fun onCreateView(
            inflater: LayoutInflater, container: ViewGroup?,
            savedInstanceState: Bundle?): View? {
            var view = inflater.inflate(R.layout.fragment_profile, container, false)
            ProfileSetting = view.findViewById(R.id.imgProfileSetting)
            return view
    
        }
    
        }

Clicking the button doesn't switch the page in app.

imgProfileSetting is button.

Upvotes: 0

Views: 38

Answers (1)

Gaya Touak
Gaya Touak

Reputation: 56

Your Button does not have any ClickListener, implement it :

ProfileSetting.setOnClickListener {
//Do your stuff
        }

Upvotes: 0

Related Questions