skip to Main Content

Android Studio – null object reference on data binding on runtime

I am using dataBinding I have MainActivity public class MainActivity extends AppCompatActivity { ActivityMainBinding binding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityMainBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); }} My gradle file buildFeatures { viewBinding true dataBinding true } dependencies { classpath…

VIEW QUESTION
Back To Top
Search