It is indeed a known bug on our side.
As for protected methods, you cannot override them if they are marked
"final".
On Jul 7, 2012 2:58 PM, "G. Blake Meike" <[email protected]> wrote:
> I'd say you've got yourself a bug. Very nice work. This code, run first
> under java 6, then under Android, confirms it for me:
>
>
> package net.callmeike.sandbox.p1;
>
> public class BaseClass {
> public void run() { callFoo(); }
>
> void foo() { System.out.println("P1 foo: " + this); }
>
> private void callFoo() { foo(); }
> }
>
>
> package net.callmeike.sandbox.p2;
> import net.callmeike.sandbox.p1.BaseClass;
>
> public class SubClass extends BaseClass {
> void foo() { System.out.println("P2 foo: " + this); }
> }
>
>
> /* Run on Android */
> package net.callmeike.android.sandbox;
>
> import android.os.Bundle;
> import android.app.Activity;
> import net.callmeike.sandbox.p2.SubClass;
>
> public class SandboxActivity extends Activity {
>
> @Override
> public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
>
> SubClass obj = new SubClass();
> System.out.println("onCreate with: " + obj);
> obj.run();
> }
> }
>
> LOGCAT OUTPUT
> 07-07 14:46:57.141: I/System.out(1029): onCreate with:
> net.callmeike.sandbox.p2.SubClass@411ed330
> 07-07 14:46:57.141: I/System.out(1029): P2 foo:
> net.callmeike.sandbox.p2.SubClass@411ed330
> 07-07 14:46:57.500: D/gralloc_goldfish(1029): Emulator without GPU
> emulation detected.
>
>
> /* Run under Java 6 */
> package net.callmeike.sandbox;
> import net.callmeike.sandbox.p2.SubClass;
>
> public class Bug {
> public static void main(String[] args) {
> SubClass obj = new SubClass();
> System.out.println("main with: " + obj);
> obj.run();
> }
> }
>
> CONSOLE OUTPUT
> main with: net.callmeike.sandbox.p2.SubClass@17dfafd1
> P1 foo: net.callmeike.sandbox.p2.SubClass@17dfafd1
>
> --
> 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
--
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