'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference - AlgoliaStrange out of memory issue while loading an image to a Bitmap objectHow to send an object from one Android Activity to another using Intents?Dialog throwing "Unable to add window — token null is not for an application” with getApplication() as contextjava.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object referenceGiven URL play video in androidUsing Algolia with nested object that have unique keysAlgolia and globalizationAlgolia and MasonryAlgolia - InstantSearchHelper'void com.algolia.instantsearch.core.helpers.Searcher.destroy()' on a null object reference

What does the phrase "go for the pin" mean here?

Copper as an adjective to refer to something made of copper

Huffman Code in C++

What is monoid homomorphism exactly?

Installing Debian 10, upgrade to stable later?

How did the Force make Luke hard to hit in the Battle of Yavin?

Explaining intravenous drug abuse to a small child

In "Avengers: Endgame", what does this name refer to?

Problem with estimating a sequence with intuition

What is more safe for browsing the web: PC or smartphone?

hl with custom color and linebreak and math

How to speed up large double sums in a table?

Can I combine SELECT TOP() with the IN operator?

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

How to use awk to extract data from a file based on the content of another file?

What does のそ mean on this picture?

Emergency stop in plain TeX, pdfTeX, XeTeX and LuaTeX?

Can a good but unremarkable PhD student become an accomplished professor?

Why doesn't a particle exert force on itself?

How to say something covers all the view up to the horizon line?

How to preserve a rare version of a book?

While drilling into kitchen wall, hit a wire - any advice?

How important are good looking people in a novel/story?

Two denim hijabs



'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference - Algolia


Strange out of memory issue while loading an image to a Bitmap objectHow to send an object from one Android Activity to another using Intents?Dialog throwing "Unable to add window — token null is not for an application” with getApplication() as contextjava.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object referenceGiven URL play video in androidUsing Algolia with nested object that have unique keysAlgolia and globalizationAlgolia and MasonryAlgolia - InstantSearchHelper'void com.algolia.instantsearch.core.helpers.Searcher.destroy()' on a null object reference






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















The Error:



java.lang.NullPointerException: Attempt to invoke virtual method 'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference


I double checked the names to the references used. Seems fine to me. I don't know why I keep getting this error. The view crashes as soon as I open it.



protected void onCreate(Bundle savedInstanceState) 
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_findfriend);

searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME);
helper = new InstantSearch(this, searcher);
helper.search();



// Get a reference to your Hits widget
final Hits hits = (Hits) findViewById(R.id.hits);

// Add an OnItemClickListener
hits.setOnItemClickListener(new ItemClickSupport.OnItemClickListener()
@Override
public void onItemClick(RecyclerView recyclerView, int position, View v)
JSONObject hit = hits.get(position);
// Do something with the hit

);


@Override
protected void onDestroy()
searcher.destroy();
super.onDestroy();

}


Here's my Activity:



activity_findfriend.xml



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:algolia="http://schemas.android.com/apk/res-auto"
android:paddingTop="0dp"
android:background="@color/white">

<LinearLayout
android:id="@+id/search_emoji"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
android:background="@drawable/search_drawable"
android:gravity="top"
android:paddingTop="8dp"
android:orientation="horizontal">

<com.algolia.instantsearch.ui.views.SearchBox
android:id="@+id/searchBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/message_rectangle"
android:layout_marginRight="12dp"
android:layout_marginLeft="12dp"/>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/search_emoji">

<com.algolia.instantsearch.ui.views.Hits
android:id="@+id/hits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
algolia:itemLayout="@layout/hits_item"
android:layout_below="@+id/search_emoji"/>
</LinearLayout>











share|improve this question






























    1















    The Error:



    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference


    I double checked the names to the references used. Seems fine to me. I don't know why I keep getting this error. The view crashes as soon as I open it.



    protected void onCreate(Bundle savedInstanceState) 
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_findfriend);

    searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME);
    helper = new InstantSearch(this, searcher);
    helper.search();



    // Get a reference to your Hits widget
    final Hits hits = (Hits) findViewById(R.id.hits);

    // Add an OnItemClickListener
    hits.setOnItemClickListener(new ItemClickSupport.OnItemClickListener()
    @Override
    public void onItemClick(RecyclerView recyclerView, int position, View v)
    JSONObject hit = hits.get(position);
    // Do something with the hit

    );


    @Override
    protected void onDestroy()
    searcher.destroy();
    super.onDestroy();

    }


    Here's my Activity:



    activity_findfriend.xml



    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:algolia="http://schemas.android.com/apk/res-auto"
    android:paddingTop="0dp"
    android:background="@color/white">

    <LinearLayout
    android:id="@+id/search_emoji"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_marginStart="0dp"
    android:layout_marginTop="0dp"
    android:background="@drawable/search_drawable"
    android:gravity="top"
    android:paddingTop="8dp"
    android:orientation="horizontal">

    <com.algolia.instantsearch.ui.views.SearchBox
    android:id="@+id/searchBox"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/message_rectangle"
    android:layout_marginRight="12dp"
    android:layout_marginLeft="12dp"/>
    </LinearLayout>

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/search_emoji">

    <com.algolia.instantsearch.ui.views.Hits
    android:id="@+id/hits"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    algolia:itemLayout="@layout/hits_item"
    android:layout_below="@+id/search_emoji"/>
    </LinearLayout>











    share|improve this question


























      1












      1








      1








      The Error:



      java.lang.NullPointerException: Attempt to invoke virtual method 'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference


      I double checked the names to the references used. Seems fine to me. I don't know why I keep getting this error. The view crashes as soon as I open it.



      protected void onCreate(Bundle savedInstanceState) 
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_findfriend);

      searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME);
      helper = new InstantSearch(this, searcher);
      helper.search();



      // Get a reference to your Hits widget
      final Hits hits = (Hits) findViewById(R.id.hits);

      // Add an OnItemClickListener
      hits.setOnItemClickListener(new ItemClickSupport.OnItemClickListener()
      @Override
      public void onItemClick(RecyclerView recyclerView, int position, View v)
      JSONObject hit = hits.get(position);
      // Do something with the hit

      );


      @Override
      protected void onDestroy()
      searcher.destroy();
      super.onDestroy();

      }


      Here's my Activity:



      activity_findfriend.xml



      <?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:algolia="http://schemas.android.com/apk/res-auto"
      android:paddingTop="0dp"
      android:background="@color/white">

      <LinearLayout
      android:id="@+id/search_emoji"
      android:layout_width="match_parent"
      android:layout_height="60dp"
      android:layout_alignParentStart="true"
      android:layout_alignParentTop="true"
      android:layout_marginStart="0dp"
      android:layout_marginTop="0dp"
      android:background="@drawable/search_drawable"
      android:gravity="top"
      android:paddingTop="8dp"
      android:orientation="horizontal">

      <com.algolia.instantsearch.ui.views.SearchBox
      android:id="@+id/searchBox"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/message_rectangle"
      android:layout_marginRight="12dp"
      android:layout_marginLeft="12dp"/>
      </LinearLayout>

      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@+id/search_emoji">

      <com.algolia.instantsearch.ui.views.Hits
      android:id="@+id/hits"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      algolia:itemLayout="@layout/hits_item"
      android:layout_below="@+id/search_emoji"/>
      </LinearLayout>











      share|improve this question
















      The Error:



      java.lang.NullPointerException: Attempt to invoke virtual method 'void android.databinding.ViewDataBinding.executePendingBindings()' on a null object reference


      I double checked the names to the references used. Seems fine to me. I don't know why I keep getting this error. The view crashes as soon as I open it.



      protected void onCreate(Bundle savedInstanceState) 
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_findfriend);

      searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME);
      helper = new InstantSearch(this, searcher);
      helper.search();



      // Get a reference to your Hits widget
      final Hits hits = (Hits) findViewById(R.id.hits);

      // Add an OnItemClickListener
      hits.setOnItemClickListener(new ItemClickSupport.OnItemClickListener()
      @Override
      public void onItemClick(RecyclerView recyclerView, int position, View v)
      JSONObject hit = hits.get(position);
      // Do something with the hit

      );


      @Override
      protected void onDestroy()
      searcher.destroy();
      super.onDestroy();

      }


      Here's my Activity:



      activity_findfriend.xml



      <?xml version="1.0" encoding="utf-8"?>
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:algolia="http://schemas.android.com/apk/res-auto"
      android:paddingTop="0dp"
      android:background="@color/white">

      <LinearLayout
      android:id="@+id/search_emoji"
      android:layout_width="match_parent"
      android:layout_height="60dp"
      android:layout_alignParentStart="true"
      android:layout_alignParentTop="true"
      android:layout_marginStart="0dp"
      android:layout_marginTop="0dp"
      android:background="@drawable/search_drawable"
      android:gravity="top"
      android:paddingTop="8dp"
      android:orientation="horizontal">

      <com.algolia.instantsearch.ui.views.SearchBox
      android:id="@+id/searchBox"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/message_rectangle"
      android:layout_marginRight="12dp"
      android:layout_marginLeft="12dp"/>
      </LinearLayout>

      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@+id/search_emoji">

      <com.algolia.instantsearch.ui.views.Hits
      android:id="@+id/hits"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      algolia:itemLayout="@layout/hits_item"
      android:layout_below="@+id/search_emoji"/>
      </LinearLayout>








      android android-layout algolia






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 10:22









      Tamir Abutbul

      2,6903927




      2,6903927










      asked Mar 23 at 4:35









      ngx311ngx311

      113213




      113213






















          1 Answer
          1






          active

          oldest

          votes


















          0














          To use data binding in your layout, wrap it in a <layout> root tag.



          New hits_item.xml



          <?xml version="1.0" encoding="utf-8"?>
          <layout xmlns:algolia="http://schemas.android.com/apk/res-auto">
          <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

          android:orientation="horizontal"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:clickable="true"
          android:focusable="true"
          android:id="@+id/hits_items">
          <de.hdodenhof.circleimageview.CircleImageView
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:id="@+id/user_image"
          android:layout_width="100dp"
          android:layout_height="100dp"
          app:civ_border_width="4dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="20dp"
          android:src="@drawable/profile_thumbnail"
          app:civ_border_color="#c42f92"
          algolia:attribute='@"image"'/>
          <TextView
          android:id="@+id/user_name"
          android:paddingTop="53dp"
          android:paddingLeft="20dp"
          android:textSize="20dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          algolia:attribute='@"username"'
          algolia:highlighted='@true'/>
          </LinearLayout>
          </layout>





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310643%2fvoid-android-databinding-viewdatabinding-executependingbindings-on-a-null-ob%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            To use data binding in your layout, wrap it in a <layout> root tag.



            New hits_item.xml



            <?xml version="1.0" encoding="utf-8"?>
            <layout xmlns:algolia="http://schemas.android.com/apk/res-auto">
            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="true"
            android:focusable="true"
            android:id="@+id/hits_items">
            <de.hdodenhof.circleimageview.CircleImageView
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/user_image"
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:civ_border_width="4dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="20dp"
            android:src="@drawable/profile_thumbnail"
            app:civ_border_color="#c42f92"
            algolia:attribute='@"image"'/>
            <TextView
            android:id="@+id/user_name"
            android:paddingTop="53dp"
            android:paddingLeft="20dp"
            android:textSize="20dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            algolia:attribute='@"username"'
            algolia:highlighted='@true'/>
            </LinearLayout>
            </layout>





            share|improve this answer



























              0














              To use data binding in your layout, wrap it in a <layout> root tag.



              New hits_item.xml



              <?xml version="1.0" encoding="utf-8"?>
              <layout xmlns:algolia="http://schemas.android.com/apk/res-auto">
              <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

              android:orientation="horizontal"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:clickable="true"
              android:focusable="true"
              android:id="@+id/hits_items">
              <de.hdodenhof.circleimageview.CircleImageView
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:id="@+id/user_image"
              android:layout_width="100dp"
              android:layout_height="100dp"
              app:civ_border_width="4dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="20dp"
              android:src="@drawable/profile_thumbnail"
              app:civ_border_color="#c42f92"
              algolia:attribute='@"image"'/>
              <TextView
              android:id="@+id/user_name"
              android:paddingTop="53dp"
              android:paddingLeft="20dp"
              android:textSize="20dp"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              algolia:attribute='@"username"'
              algolia:highlighted='@true'/>
              </LinearLayout>
              </layout>





              share|improve this answer

























                0












                0








                0







                To use data binding in your layout, wrap it in a <layout> root tag.



                New hits_item.xml



                <?xml version="1.0" encoding="utf-8"?>
                <layout xmlns:algolia="http://schemas.android.com/apk/res-auto">
                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="true"
                android:focusable="true"
                android:id="@+id/hits_items">
                <de.hdodenhof.circleimageview.CircleImageView
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/user_image"
                android:layout_width="100dp"
                android:layout_height="100dp"
                app:civ_border_width="4dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="20dp"
                android:src="@drawable/profile_thumbnail"
                app:civ_border_color="#c42f92"
                algolia:attribute='@"image"'/>
                <TextView
                android:id="@+id/user_name"
                android:paddingTop="53dp"
                android:paddingLeft="20dp"
                android:textSize="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                algolia:attribute='@"username"'
                algolia:highlighted='@true'/>
                </LinearLayout>
                </layout>





                share|improve this answer













                To use data binding in your layout, wrap it in a <layout> root tag.



                New hits_item.xml



                <?xml version="1.0" encoding="utf-8"?>
                <layout xmlns:algolia="http://schemas.android.com/apk/res-auto">
                <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="true"
                android:focusable="true"
                android:id="@+id/hits_items">
                <de.hdodenhof.circleimageview.CircleImageView
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/user_image"
                android:layout_width="100dp"
                android:layout_height="100dp"
                app:civ_border_width="4dp"
                android:layout_marginStart="8dp"
                android:layout_marginTop="20dp"
                android:src="@drawable/profile_thumbnail"
                app:civ_border_color="#c42f92"
                algolia:attribute='@"image"'/>
                <TextView
                android:id="@+id/user_name"
                android:paddingTop="53dp"
                android:paddingLeft="20dp"
                android:textSize="20dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                algolia:attribute='@"username"'
                algolia:highlighted='@true'/>
                </LinearLayout>
                </layout>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 23 at 19:57









                ngx311ngx311

                113213




                113213





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310643%2fvoid-android-databinding-viewdatabinding-executependingbindings-on-a-null-ob%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현