c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Android

FindViewByID returns null in android studio -SOLVED

| | java

I am getting findViewByID returns null while running android application. "Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference".

FindViewById returns null

Solution:

Make sure call findViewById() below the setContentView() function.

How to fix FindViewByID returns null in android studio?