I am a new programmer. I have seen lots of tutorials but can\'t understand what is wrong. I am trying to create a ProgressBar from an Async Task. However it always crashes m
Intervals.getApp().progressBar.setProgress(values[0]);
There are two possibilities for the NullPointerException
in this line of code:
getApp()
returns null
progressBar
is null
In order to determine which is the cause, you need to split this into two separate lines:
Intervals intervals = Intervales.getApp();
intervals.progressBar.setProgress(values[0]);
Now set a breakpoint at the first line, step over it, and determine if intervals
is null
or not.