java.lang.RuntimeException

Unable to start activity ComponentInfo{com.example.ramy.medicare/com.example.ramy.medicare.Profile.materialtabs.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

Solutions on the web45850

  • Unable to start activity ComponentInfo{com.example.ramy.medicare/com.example.ramy.medicare.Profile.materialtabs.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
  • Unable to start activity ComponentInfo{com.gelajo.africancurrencyconverter/com.gelajo.africancurrencyconverter.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
  • via Coderanch by H White, 6 months ago
    Unable to start activity ComponentInfo{com.example.howar.calc/com.example.howar.calc.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
  • Stack trace

    • java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ramy.medicare/com.example.ramy.medicare.Profile.materialtabs.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    65 times, 2 weeks ago
    6 times, 2 weeks ago
    38 times, 1 month ago
    16 times, 7 months ago
    1047 times, 7 months ago
    104 more bugmates