[Galaxy S II Android Development] remuntada78:
Hi , i tried to implement code to color the screenshot button in statusbar

i added all this in PhoneStatusBar smali

.method Screenshot_color()V
.locals 5

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v1, 0x7f020176

invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/widget/ImageView;

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "checkbox_preference"

const v4, 0x1

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-eqz v2, :cond_skip_text

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "text_color"

const v4, -0x1

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

invoke-virtual {v0, v2}, Landroid/graphics/drawable/Drawable;->setColorFilter(I)V

:cond_skip_text

.end method

and this line invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->Screenshot_color()V

in makestatusbarview. method

logcat

D/SystemUIService( 2350): loading: class com.android.systemui.statusbar.phone.PhoneStatusBar

W/dalvikvm( 2350): VFY: invalid branch target 20 (-> 0x2e) at 0x1a

W/dalvikvm( 2350): VFY: rejected Lcom/android/systemui/statusbar/phone/PhoneStatusBar;.Screenshot_color ()V

W/dalvikvm( 2350): VFY: rejecting opcode 0x38 at 0x001a

W/dalvikvm( 2350): VFY: rejected Lcom/android/systemui/statusbar/phone/PhoneStatusBar;.Screenshot_color ()V

W/dalvikvm( 2350): Verifier rejected class Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

W/dalvikvm( 2350): Class init failed in newInstance call (Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)

D/AndroidRuntime( 2350): Shutting down VM

W/dalvikvm( 2350): threadid=1: thread exiting with uncaught exception (group=0x411042a0)

E/AndroidRuntime( 2350): FATAL EXCEPTION: main

E/AndroidRuntime( 2350): java.lang.VerifyError: com/android/systemui/statusbar/phone/PhoneStatusBar

E/AndroidRuntime( 2350):	at java.lang.Class.newInstanceImpl(Native Method)

E/AndroidRuntime( 2350):	at java.lang.Class.newInstance(Class.java:1319)

E/AndroidRuntime( 2350):	at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:86)

E/AndroidRuntime( 2350):	at android.app.ActivityThread.handleCreateService(ActivityThread.java:2414)

E/AndroidRuntime( 2350):	at android.app.ActivityThread.access$1700(ActivityThread.java:140)

E/AndroidRuntime( 2350):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1319)

E/AndroidRuntime( 2350):	at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 2350):	at android.os.Looper.loop(Looper.java:137)

E/AndroidRuntime( 2350):	at android.app.ActivityThread.main(ActivityThread.java:4921)

E/AndroidRuntime( 2350):	at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 2350):	at java.lang.reflect.Method.invoke(Method.java:511)

E/AndroidRuntime( 2350):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)

E/AndroidRuntime( 2350):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

E/AndroidRuntime( 2350):	at dalvik.system.NativeStart.main(Native Method)