[Galaxy S II Android Development] remuntada78:
i noticed that the method already has context parameter

.method public setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

no other context used as i mean in the file

i think to change my code like this

.line 928
:cond_35
if-eqz p2, :cond_3d

.line 929
const v2, 0x1020016

invoke-virtual {v0, v2, p2}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v12

const-string v13, "title_text_color"

const v14, -0x1

invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v12

invoke-virtual {v0, v2, v12}, Landroid/widget/RemoteViews;->setTextColor(II)V[/COLOR]

what you think?

---------- Post added at 06:31 PM ---------- Previous post was at 06:05 PM ----------

i tried the above code and i got this error

W/dalvikvm( 2208): VFY: storing non-ref v14 into ref field 'contentIntent' (Landroid/app/PendingIntent;)

W/dalvikvm( 2208): VFY: rejecting opcode 0x5b at 0x0081

W/dalvikvm( 2208): VFY: rejected Landroid/app/Notification;.setLatestEventInfo (Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

W/dalvikvm( 2208): Verifier rejected class Landroid/app/Notification;

this is the entire method with my changes in red

.method public setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V
.registers [COLOR="Red"]15[/COLOR]
.parameter "context"
.parameter "contentTitle"
.parameter "contentText"
.parameter "contentIntent"
.annotation runtime Ljava/lang/Deprecated;
.end annotation

.prologue
const v6, 0x1020064

const v4, 0x1020006

.line 917
new-instance v0, Landroid/widget/RemoteViews;

invoke-virtual {p1}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

move-result-object v2

const v3, 0x10900ac

invoke-direct {v0, v2, v3}, Landroid/widget/RemoteViews;-><init>(Ljava/lang/String;I)V

.line 919
.local v0, contentView:Landroid/widget/RemoteViews;
iget v2, p0, Landroid/app/Notification;->icon:I

if-eqz v2, :cond_1b

.line 920
iget v2, p0, Landroid/app/Notification;->icon:I

invoke-virtual {v0, v4, v2}, Landroid/widget/RemoteViews;->setImageViewResource(II)V

.line 922
:cond_1b
iget v2, p0, Landroid/app/Notification;->priority:I

const/4 v3, -0x1

if-ge v2, v3, :cond_35

.line 923
const-string/jumbo v2, "setBackgroundResource"

const v3, 0x1080a4d

invoke-virtual {v0, v4, v2, v3}, Landroid/widget/RemoteViews;->setInt(ILjava/lang/String;I)V

.line 925
const v2, 0x10203c2

const-string/jumbo v3, "setBackgroundResource"

const v4, 0x1080556

invoke-virtual {v0, v2, v3, v4}, Landroid/widget/RemoteViews;->setInt(ILjava/lang/String;I)V

.line 928
:cond_35
if-eqz p2, :cond_3d

.line 929
const v2, 0x1020016

invoke-virtual {v0, v2, p2}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v12

const-string v13, "title_text_color"

const v14, -0x1

invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v12

invoke-virtual {v0, v2, v12}, Landroid/widget/RemoteViews;->setTextColor(II)V[/COLOR]

.line 931
:cond_3d
if-eqz p3, :cond_45

.line 932
const v2, 0x1020046

invoke-virtual {v0, v2, p3}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

.line 934
:cond_45
iget-wide v2, p0, Landroid/app/Notification;->when:J

const-wide/16 v4, 0x0

cmp-long v2, v2, v4

if-eqz v2, :cond_59

.line 935
const/4 v2, 0x0

invoke-virtual {v0, v6, v2}, Landroid/widget/RemoteViews;->setViewVisibility(II)V

.line 936
const-string/jumbo v2, "setTime"

iget-wide v3, p0, Landroid/app/Notification;->when:J

invoke-virtual {v0, v6, v2, v3, v4}, Landroid/widget/RemoteViews;->setLong(ILjava/lang/String;J)V

.line 938
:cond_59
iget v2, p0, Landroid/app/Notification;->number:I

if-eqz v2, :cond_6e

.line 939
invoke-static {}, Ljava/text/NumberFormat;->getIntegerInstance()Ljava/text/NumberFormat;

move-result-object v1

.line 940
.local v1, f:Ljava/text/NumberFormat;
const v2, 0x10203c6

iget v3, p0, Landroid/app/Notification;->number:I

int-to-long v3, v3

invoke-virtual {v1, v3, v4}, Ljava/text/NumberFormat;->format(J)Ljava/lang/String;

move-result-object v3

invoke-virtual {v0, v2, v3}, Landroid/widget/RemoteViews;->setTextViewText(ILjava/lang/CharSequence;)V

.line 943
.end local v1 #f:Ljava/text/NumberFormat;
:cond_6e
iput-object v0, p0, Landroid/app/Notification;->contentView:Landroid/widget/RemoteViews;

.line 944
iput-object p4, p0, Landroid/app/Notification;->contentIntent:Landroid/app/PendingIntent;

.line 945
return-void
.end method

i think i've a problem with the last iput-object before return-void

edit:the problem was the value of registers i added ,they don't need to be v12, v13, v14 but v7, v8, v9, sorry my bad