I am new to Android programming and I try to learn it and take sample sample applications on the git * ub site, I have tried to resolve some errors in the application and after compiling the application is able to run, but the problem that arises when I open the details from the application post, the error is like this
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.newsagni/com.app.newsagni.ActivityPostDetails}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2550)
at android.app.ActivityThread.access$1100(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1401)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5615)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.app.newsagni.ActivityPostDetails.displayPostData(ActivityPostDetails.java:190)
at com.app.newsagni.ActivityPostDetails.onCreate(ActivityPostDetails.java:98)
at android.app.Activity.performCreate(Activity.java:6362)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2443)
... 9 more
The following listings from
ActivityPostDetails.java https://pastebin.com/h56LUx2T
activity_post_details.xml https://pastebin.com/hwYpza37
Can you help me overcome this error