title: Attempt to invoke virtual method on a null object reference while starting an Intent
body: <p>First of all i know that there are tons of those questions already but believe me i searched and haven't found anything that would solve my problem</p>
  
  <p>Situation looks like this. I try to start new intent in recyclerView adapter in onClick method and app crashes on startActivity with (second method from the bottom) </p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.ActivityThread$ApplicationThread android.app.ActivityThread.getApplicationThread()' on a null object reference
  </code></pre>
  
  <p>and here is my recyclerView class</p>
  
  <pre><code>public class RecyclerView_Config extends FragmentActivity {
  private Context mContext;
  private BooksAdapter mBooksAdapter;
  private RecyclerView mRecyclerView;
  private View.OnClickListener onItemClickListener;
  
  public void setConfig(RecyclerView recyclerView, Context context, List&lt;Book&gt; books, List&lt;String&gt; keys ){
  
      mContext = context;
      mBooksAdapter = new BooksAdapter(books, keys);
      mRecyclerView = recyclerView;
      mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
      mRecyclerView.setAdapter(mBooksAdapter);
  
  }
  
  //inflate layout BookListItem
  class BookItemView extends RecyclerView.ViewHolder{
  
      private TextView mTitle;
      private TextView mAuthor;
      private TextView mIsbn;
      private TextView mCategory;
  
      private String key;
  
      public BookItemView(View inflatedView){
          super(inflatedView);
          inflatedView.setTag(this);
          inflatedView.setOnClickListener(onItemClickListener);
  
          mTitle = inflatedView.findViewById(R.id.title_textView);
          mAuthor = inflatedView.findViewById(R.id.author_textView);
          mCategory = inflatedView.findViewById(R.id.category_textView);
          mIsbn = inflatedView.findViewById(R.id.isbn_textView);
      }
  
      public void bind (Book book, String key){
          mTitle.setText(book.getTitle());
          mAuthor.setText(book.getAuthor());
          mCategory.setText(book.getCategory());
          mIsbn.setText(book.getIsbn());
          this.key = key;
      }
  
      public void setItemClickListener(View.OnClickListener clickListener)
      {
          onItemClickListener = clickListener;
      }
  }
  
  // creating bookItemView
  class BooksAdapter extends RecyclerView.Adapter&lt;BookItemView&gt; {
      private List&lt;Book&gt; mBookList;
      private List&lt;String&gt; mKeys;
      private ReviewFragment mFragment;
      public static final String EXTRA_MESSAGE = "com.example.bookrate.MESSAGE";
  
  
      public BooksAdapter(List&lt;Book&gt; mBookList, List&lt;String&gt; mKeys) {
          this.mBookList = mBookList;
          this.mKeys = mKeys;
      }
  
      @NonNull
      @Override
      public BookItemView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
          return new BookItemView(LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.book_list_item,parent, false));
  
      }
  
      @Override
      public void onBindViewHolder(@NonNull BookItemView holder, final int position) {
          holder.bind(mBookList.get(position), mKeys.get(position));
          holder.setItemClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String isbn = mBookList.get(position).isbn;
                  Intent intent = new Intent(v.getContext(), BookDetailActivity.class);
                  intent.putExtra(EXTRA_MESSAGE, isbn);
                  startActivity(intent);
              }
          });
      }
  
      @Override
      public int getItemCount() {
          return mBookList.size();
      }
  }
  }
  </code></pre>
  
  <p>Here is the picture of debbuger (still i can't see why it does not work) 
  <a href="https://i.stack.imgur.com/Zkj5D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zkj5D.png" alt="enter image description here"></a></p>
  
  <p>and here is full error if needed </p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.example.bookrate, PID: 9950
  java.lang.NullPointerException: Attempt to invoke virtual method 'android.app.ActivityThread$ApplicationThread android.app.ActivityThread.getApplicationThread()' on a null object reference
      at android.app.Activity.startActivityForResult(Activity.java:4588)
      at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:675)
      at android.app.Activity.startActivityForResult(Activity.java:4545)
      at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:662)
      at android.app.Activity.startActivity(Activity.java:4906)
      at android.app.Activity.startActivity(Activity.java:4874)
      at com.example.bookrate.RecyclerView_Config$BooksAdapter$1.onClick(RecyclerView_Config.java:107)
      at android.view.View.performClick(View.java:6597)
      at android.view.View.performClickInternal(View.java:6574)
      at android.view.View.access$3100(View.java:778)
      at android.view.View$PerformClick.run(View.java:25889)
      at android.os.Handler.handleCallback(Handler.java:873)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:193)
      at android.app.ActivityThread.main(ActivityThread.java:6746)
      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>any help would be really appreciated becouse after few hours im clueless </p>
  
  <p>Here is manifest </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  
  &lt;uses-feature android:name="android.hardware.camera" /&gt;
  &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;
  &lt;uses-feature android:name="android.hardware.camera.flash" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"
      android:usesCleartextTraffic="true"&gt;
      &lt;activity android:name=".BookDetailActivity"&gt;&lt;/activity&gt;
      &lt;activity android:name=".RegisterActivity" /&gt;
      &lt;activity
          android:name=".LoginActivity"
          android:label="@string/title_activity_login"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".MainActivity" /&gt;
      &lt;activity android:name=".RecyclerView_Config" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>and no i did not declare that activity but it looks like AS got my back on this</p>