0

Im working on a simple application, that can record your Airtime when jumping with your mountainbike or while skiing.

For this i added three fragments. The first one shows you your Airtime after doing a jump. The second one the raw data and the third one should show a graph, which plots the jump data (not working yet, but a different story).

There are two Buttons above the Fragment section, which start and stop the recording and a third one, that loads the data (that is stored on the external storage of the phone) back to the app.

After hitting "Load" you can see the Airtime and the Data as it should be, but the thing is when rebooting the app, you have to swipe the tabs at least once, before hitting start, or else the app is crashing. I am getting this Error:

APPLICATION: JNI CallVoidMethodV called with pending exception java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

But if i swipe once before i start recording everything is working as it should.

In similar questions on the internet the problem with the null pointer error was with Ids or text view names not matching in java and xml files, but this is not the problem here, i checked.

I am rather new to java and coding, so maybe there is something really obvious I am overseeing.

0 Answers0