Closed Bug 705041 Opened 10 years ago Closed 10 years ago

Unable to resolve virtual method 1210: Lorg/mozilla/gecko/GeckoApp;.getActionBar


(Firefox for Android Graveyard :: General, defect, P4)



(Not tracked)



(Reporter: mfinkle, Assigned: sriram)



(1 file)

Even though the code is not executed, the byte code is verified. The result dumps this into logcat. It would be nice to remove it, just for cleanliness:

I/dalvikvm( 8686): Could not find method org.mozilla.gecko.GeckoApp.getActionBar, referenced from method org.mozilla.gecko.GeckoApp.onCreate
W/dalvikvm( 8686): VFY: unable to resolve virtual method 1210: Lorg/mozilla/gecko/GeckoApp;.getActionBar ()Landroid/app/ActionBar;
D/dalvikvm( 8686): VFY: replacing opcode 0x6e at 0x006b
D/dalvikvm( 8686): VFY: dead code 0x006e-0090 in Lorg/mozilla/gecko/GeckoApp;.onCreate (Landroid/os/Bundle;)V

I found this method for doing it:

It uses a helper class to hide the bytecode.
Attached patch PatchSplinter Review
This patch uses the Helper class pattern.
I don't see any error with this.
However, I don't quite like this pattern :(
We would have to shadow each function we use from ActionBar - which could get messier.
I tried looking at alternative options, but couldn't find any.
Attachment #578062 - Flags: review?(mark.finkle)
Comment on attachment 578062 [details] [diff] [review]

You mentioned doing this using styles. Can we see that patch too?
Doing with styles isn't working well. Though there are XML attributes for the method equivalents in Java, somehow it is not taking them properly. Like for e.g., I tried setting up "showHome|homeAsUp" as an XML attribute. I allows me to go back, but doesn't show me the arrow -- which is shown if we use Java methods.

Also, the custom layout is not working either. We need to get the actionBar, to get the mBrowserToolbar during onCreate(), which will still case "VFY error", demanding us to use classes (like in the above patch).

I would probably go with the above approach for now. I'll try to find a better approach later.
Attachment #578062 - Flags: review?(mark.finkle) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.