[Galaxy S II Android Development] remuntada78:
Hi to all, i tried to work with Eclipse to find a way to change the color of a pressed button, It seems that I've done, but in the apk that i created the code that i need is divided into two smali file so i don't know how to implement in my file for my goalhttp://xdaforums.com/showpost.php?p=49785506&postcount=349

first smali

.class public Lcom/provabottone/MainActivity;
.super Landroid/app/Activity;
.source "MainActivity.java"

# direct methods
.method public constructor <init>()V
.locals 0

.prologue
.line 14
invoke-direct {p0}, Landroid/app/Activity;-><init>()V

return-void
.end method

# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"

.prologue
.line 21
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

.line 22
const/high16 v1, 0x7f03

invoke-virtual {p0, v1}, Lcom/provabottone/MainActivity;->setContentView(I)V

.line 25
const/high16 v1, 0x7f08

invoke-virtual {p0, v1}, Lcom/provabottone/MainActivity;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/widget/Button;

.line 26
.local v0, btn:Landroid/widget/Button;
new-instance v1, Lcom/provabottone/MainActivity$1;

invoke-direct {v1, p0, v0}, Lcom/provabottone/MainActivity$1;-><init>(Lcom/provabottone/MainActivity;Landroid/widget/Button;)V

invoke-virtual {v0, v1}, Landroid/widget/Button;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

.line 41
return-void
.end method

second smali in blue lines for button pressed in red lines for button normal

.class Lcom/provabottone/MainActivity$1;
.super Ljava/lang/Object;
.source "MainActivity.java"

# interfaces
.implements Landroid/view/View$OnTouchListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/provabottone/MainActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/provabottone/MainActivity;

.field private final synthetic val$btn:Landroid/widget/Button;

# direct methods
.method constructor <init>(Lcom/provabottone/MainActivity;Landroid/widget/Button;)V
.locals 0
.parameter
.parameter

.prologue
.line 1
iput-object p1, p0, Lcom/provabottone/MainActivity$1;->this$0:Lcom/provabottone/MainActivity;

iput-object p2, p0, Lcom/provabottone/MainActivity$1;->val$btn:Landroid/widget/Button;

.line 26
invoke-direct {p0}, Ljava/lang/Object;-><init>()V

return-void
.end method

# virtual methods
.method public onTouch(Landroid/view/View;Landroid/view/MotionEvent;)Z
.locals 6
.parameter "arg0"
.parameter "me"

.prologue
const/4 v0, 0x1

.line 31
invoke-virtual {p2}, Landroid/view/MotionEvent;->getAction()I

move-result v1

if-nez v1, :cond_0

[COLOR="Blue"] .line 32
iget-object v1, p0, Lcom/provabottone/MainActivity$1;->val$btn:Landroid/widget/Button;

const/16 v2, 0x96

const/16 v3, 0xc8

const/16 v4, 0xb9

const/16 v5, 0x87

invoke-static {v2, v3, v4, v5}, Landroid/graphics/Color;->argb(IIII)I

move-result v2

invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundColor(I)V[/COLOR]

.line 38
:goto_0
return v0

.line 34
:cond_0
invoke-virtual {p2}, Landroid/view/MotionEvent;->getAction()I

move-result v1

if-ne v1, v0, :cond_1

[COLOR="Red"] .line 35
iget-object v1, p0, Lcom/provabottone/MainActivity$1;->val$btn:Landroid/widget/Button;

const v2, 0x7f020001

invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundColor(I)V[/COLOR]

goto :goto_0

.line 38
:cond_1
const/4 v0, 0x0

goto :goto_0
.end method

i suppose that in blue lines I have to remove these

const/16 v2, 0x96

const/16 v3, 0xc8

const/16 v4, 0xb9

const/16 v5, 0x87

invoke-static {v2, v3, v4, v5}, Landroid/graphics/Color;->argb(IIII)I

because are used to assign a specific color,so i need to add Id for my button pressed, then after this line invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundColor(I)V i need to add code for changecolor with color picker

I need help,thanks:D