I liked to override a Gallery widget class, so I tried to override and I faced the problem of using protected variable.
this is a Gallery source @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); /* * Remember that we are in layout to prevent more layout request from * being generated. [android comment] */ mInLayout = true; layout(0, false); mInLayout = false; } and I changed @Override protected void onLayout (boolean changed, int l, int t, int r, int b) { super.onLayout (changed, l, t, r, b); mInLayout = true; MyLayout (0, false); minLayout = false; } I build.. and result is /home/bobos26/work/devel/omap_test/packages/apps/Launcher/src/com/ android/launcher/WRGallery.java:27: mInLayout is not public in android.widget.AdapterView; cannot be accessed from outside package mInLayout = true; ^ the result log mean that I can't accessed the protected variable mInLayout from outside package. I think I can access a parent's protected variable when overriding class in Object oriented programming theory. am I wrong? and is there a good solution to access a parent's protected variable? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---