you are right. Cheers!
Jiri
Mark Murphy wrote:
> Jiri wrote:
>> I think it is a scoping issue, but I cant seem to find how to solve it.
>> I would appreciate some help.
>>
>>
>> public class SliderTest extends Activity {
>>
>> private HorizontalSlider slider;
>>
>> public TextView pView;
>>
>>
>> @Override
>> public void onCreate(Bundle icicle) {
>>
>> super.onCreate(icicle);
>>
>> setContentView(R.layout.main);
>>
>> slider = (HorizontalSlider) this.findViewById(R.id.slider);
>>
>> pView = (TextView) findViewById(R.id.label);
>>
>> slider.setOnChangeListener( new OnProgressChangeListener() {
>>
>> public void onProgressChanged(View v, int progress) {
>> /// CRASHES HERE , it seems pView is not know here!!
>> /// tried this SliderTest.this.pView
>> String myString = Integer.toString(progress);
>> pView.setText( myString );
>> }
>> });
>>
>> }
>>
>> }
>
> If it compiles, you do not have a scope problem.
>
> More likely, pView is null. You can determine this by checking the Java
> stack trace, available from adb logcat, DDMS, or the DDMS perspective in
> Eclipse.
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---