title: when item is selected from list , that item is not displayed in textview(EditorFragment)
body: <p>EditorFragment , textview : onclick, dialogfragment will open,
  dialogfragment, two parts : a) searchfield b) recyclerview.
  adapter , it handles, item selection from list.</p>
  
  <p>EditorFragment code : in editorfragment, after slection of item, that item will display in textview;</p>
  
  <pre><code>    public class EditorFragment extends Fragment {
  
      public static TextView tv_custom_spinner;
      private Context context;
      SearchAdapter searchAdapter = null;
      List&lt;SearchModel&gt; searchModelList ;
  
  
      public EditorFragment(Context context) {
          this.context = context;
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View view = inflater.inflate(R.layout.fragment_blank, container, false);
          searchModelList = new ArrayList&lt;&gt;();
          searchModelList.add(new SearchModel("First Name"));
          searchModelList.add(new SearchModel("Second Name"));
          searchModelList.add(new SearchModel("Third Name"));
          searchModelList.add(new SearchModel("Fourth Name"));
          searchModelList.add(new SearchModel("Fifth Name"));
          searchModelList.add(new SearchModel("Sixth Name"));
  
          searchAdapter = new SearchAdapter(context,searchModelList);
  
          setResources(view);
          clickSpinner();
          return view;
      }
  
      private void setResources(View view){
          tv_custom_spinner = view.findViewById(R.id.tv_custom_spinner);
      }
  
      private void clickSpinner(){
          tv_custom_spinner.setOnClickListener(v-&gt;{
              FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
              SpinnerDialogfragment spinnerDialogFragment= new  SpinnerDialogfragment(context, searchModelList);
  
              spinnerDialogFragment.show(fragmentManager, "SPINNER");
          });
  
          searchAdapter.setUpdateDataListener(value -&gt; tv_custom_spinner.setText(value));
      }
  }
  </code></pre>
  
  <p>Adapter code : </p>
  
  <pre><code>public class SearchAdapter  extends RecyclerView.Adapter&lt;SearchAdapter.SearchHolder&gt;{
  
      private Context context;
      private List&lt;SearchModel&gt; searchModelsList;
      private String title;
  
  
      public interface UpdateDataListener{
          void onItemSelected(String value);
      }
  
      public UpdateDataListener listener;
  
      public SearchAdapter(Context context, List&lt;SearchModel&gt; searchModelsList) {
          this.context = context;
          this.searchModelsList = searchModelsList;
  
          this.listener = null;
      }
  
      public  void setUpdateDataListener(UpdateDataListener listener){
          this.listener = listener;
      }
  
      @NonNull
      @Override
      public SearchAdapter.SearchHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int position) {
          View view = LayoutInflater.from(context).inflate(R.layout.search_item_list, null);
          return new SearchHolder(view);
      }
  
      @Override
      public void onBindViewHolder(@NonNull SearchHolder searchHolder, int position) {
  
          searchHolder.tv_searched_item.setText(searchModelsList.get(position).getItemTitle());
  
          searchHolder.itemView.setOnClickListener(v -&gt; {
              title = searchModelsList.get(position).getItemTitle();
              listener.onItemSelected(title);
          });
      }
  
      @Override
      public int getItemCount() {
          return searchModelsList.size();
      }
  
      class SearchHolder extends RecyclerView.ViewHolder{
  
          private TextView tv_searched_item;
  
          public SearchHolder(@NonNull View itemView) {
              super(itemView);
  
              tv_searched_item = itemView.findViewById(R.id.tv_searched_item);
          }
      }
  }
  </code></pre>
  
  <p>error :</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.coco.myapplication, PID: 25724
      java.lang.NullPointerException: Attempt to invoke interface method 'void com.coco.myapplication.SearchAdapter$UpdateDataListner.onItemSelected(java.lang.String)' on a null object reference
          at com.coco.myapplication.SearchAdapter.lambda$onBindViewHolder$0$SearchAdapter(SearchAdapter.java:53)
          at com.coco.myapplication.-$$Lambda$SearchAdapter$fc2DFbNCnzN7ljubXWaQ4mEoai8.onClick(Unknown Source:4)
          at android.view.View.performClick(View.java:6608)
          at android.view.View.performClickInternal(View.java:6585)
          at android.view.View.access$3100(View.java:782)
          at android.view.View$PerformClick.run(View.java:25945)
          at android.os.Handler.handleCallback(Handler.java:874)
          at android.os.Handler.dispatchMessage(Handler.java:100)
          at android.os.Looper.loop(Looper.java:198)
          at android.app.ActivityThread.main(ActivityThread.java:6729)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>
  
  <p>Process 25724 terminated.</p>