[Galaxy S II Android Development] gerryS2:
Hi [MENTION=3065070]Goldie[/MENTION], I need help.

I tried to put the code in another location and created a new way to change the text, but finding an error in the constructor method with logcat.

The file is CircleLockscreen and the code in .method public constructor <init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V is :

iput-object v3, v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mShortcutWidget:Lcom/android/internal/policy/impl/sec/CircleShortcutWidget;

[COLOR="Red"]const v3, 0x10205ae

move-object/from16 v0, p0

invoke-virtual {v0, v3}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->findViewById(I)Landroid/view/View;

move-result-object v3

check-cast v3, Landroid/widget/TextView;

move-object/from16 v0, p0

iput-object v3, v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mLockscreenCustomText:Landroid/widget/TextView;

move-object/from16 v0, p0

invoke-virtual {v0}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->updatelockscreentext()V[/COLOR]

.line 669
const v3, 0x10202f9

move-object/from16 v0, p0

invoke-virtual {v0, v3}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->findViewById(I)Landroid/view/View;

move-result-object v3

check-cast v3, Landroid/widget/FrameLayout;

I have insert this custom method in virtual methods:

.method updatelockscreentext()V
.locals 9

.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "text_color_lockscreen"

const v2, -0x111112

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

move-result v3

iget-object v0, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "text_edit_lockscreen"

invoke-static {v0, v1}, Landroid/provider/Settings$System;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

move-result-object v4

iget-object v5, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mLockscreenCustomText:Landroid/widget/TextView;

invoke-virtual {v5, v3}, Landroid/widget/TextView;->setTextColor(I)V

iget-object v5, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mLockscreenCustomText:Landroid/widget/TextView;

invoke-virtual {v5, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

iget-object v0, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "enable_text_lockscreen"

const/4 v2, 0x1

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

move-result v6

const/4 v7, 0x1

if-ne v6, v7, :cond_4

const/4 v8, 0x1

:goto_1
iget-object v5, p0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;->mLockscreenCustomText:Landroid/widget/TextView;

if-eqz v8, :cond_5

const/4 v6, 0x0

:goto_2
invoke-virtual {v5, v6}, Landroid/widget/TextView;->setVisibility(I)V

return-void

:cond_4
const/4 v8, 0x0

goto/16 :goto_1

:cond_5
const/16 v6, 0x8

goto :goto_2
.end method

The error in logcat is a NullPointerException

D/CircleShortcutWidget( 2333): iconWidth < width && iconHeight < height

W/dalvikvm( 2333): threadid=26: thread exiting with uncaught exception (group=0x410fb2a0)

E/android.os.Debug( 2333): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_sys_error

E/AndroidRuntime( 2333): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy

E/AndroidRuntime( 2333): java.lang.NullPointerException

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.sec.CircleLockScreen.updatelockscreentext(CircleLockScreen.java)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.sec.CircleLockScreen.<init>(CircleLockScreen.java:662)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.LockPatternKeyguardView.createLockScreen(LockPatternKeyguardView.java)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.LockPatternKeyguardView.recreateLockScreen(LockPatternKeyguardView.java:973)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.LockPatternKeyguardView.updateScreen(LockPatternKeyguardView.java:1217)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.LockPatternKeyguardView.access$400(LockPatternKeyguardView.java:112)

E/AndroidRuntime( 2333):	at com.android.internal.policy.impl.LockPatternKeyguardView$1.run(LockPatternKeyguardView.java:310)

E/AndroidRuntime( 2333):	at android.os.Handler.handleCallback(Handler.java:615)

E/AndroidRuntime( 2333):	at android.os.Handler.dispatchMessage(Handler.java:92)

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

E/AndroidRuntime( 2333):	at com.android.server.wm.WindowManagerService$PolicyThread.run(WindowManagerService.java:967)

I/dumpstate( 5272): begin

How I can resolve this prolem?