Does the Compat pre/suffix has to used everywhere, in xml and code? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Does the Compat pre/suffix has to used everywhere, in xml and code? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

if there is for example an

androidx.appcompat.widget.AppCompatButton

in my layout do i then also have to reference it in the code of that type, or can i also just catch it as

Button btn = findViewById(R.id.idOfAboveCompatLayout)

Answer

AppCompatButton extends from Button, so your findViewById() is fine. In general, AppCompatSnicklefritz extends from Snicklefritz (for varying values of Snicklefritz), so you can cast to Snicklefritz without problems.

We are here to answer your question about Does the Compat pre/suffix has to used everywhere, in xml and code? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji