I have doubt on String literal uninitialised variable html. Running version and trace are matching line number 95 is comment.
public class WebviewActivity extends AppCompatActivity {
String html;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
super.onResume();
generateChart();
}
private void generateChart(){
html = "<!DOCTYPE html>";
html += "<head>";
...
}
}
Not able to understand fully this crash. A method is in defined in NDK lib generateChart and in webview activity also with same name but different signatures. Native method is called in webview through ndk wrapper. I am confused with crash line Method.Invoke(Native method) Is this crash due to native method or Java method? And how to simulate this error to debug.
java.lang.RuntimeException:
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4330)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4362)
at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2128)
at android.os.Handler.dispatchMessage (Handler.java:107)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7711)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950)
Caused by: java.lang.NullPointerException:
at in.multinetsystems.vedicastro.util.WebviewActivity.generateChart (WebviewActivity.java:95)
at in.multinetsystems.vedicastro.util.WebviewActivity.onResume (WebviewActivity.java:37)
at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1567)
at android.app.Activity.performResume (Activity.java:7989)
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4320)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4362)
at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2128)
at android.os.Handler.dispatchMessage (Handler.java:107)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:7711)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950)
Thanks