Answer the question
In order to leave comments, you need to log in
Three lines that need an explanation!?
Trying to understand this code
1- In the layout, id.seek is SeekBar, and the type is specified as ProgressBar
2- `mProgress instanceof SeekBar` . Here ( javapd.blogspot.com/2008/05/25-8.html) it says
The instanceof operator checks whether the class of the left operand matches the name of the class given by the right operand or is a subclass of it.
private ProgressBar mProgress;
...
// 1.тип указывается ProgressBar, а привязывается к SeekBar???
mProgress = (ProgressBar) v.findViewById(R.id.seek);
if (mProgress != null){
// 2....
if (mProgress instanceof SeekBar){
// 3....
SeekBar seeker = (SeekBar) mProgress;
seeker.setOnSeekBarChangeListener(seekListener);
}
mProgress.setMax(1000);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question