[Galaxy S II Android Development] remuntada78:
I want to explain that i create a simple app with eclipse, where when i touch a imageview it show random image,i've extract that app and decompiled to obtein the random code in smali,but this code is divided into two smali files

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

# instance fields
.field private image:Landroid/widget/ImageView;

.field private mImageIds:[Ljava/lang/Integer;

.field final rand:Ljava/util/Random;

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

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

.line 20
new-instance v0, Ljava/util/Random;

invoke-direct {v0}, Ljava/util/Random;-><init>()V

iput-object v0, p0, Lcom/grigview/MainActivity;->rand:Ljava/util/Random;

.line 22
const/4 v0, 0x3

new-array v0, v0, [Ljava/lang/Integer;

const/4 v1, 0x0

.line 23
const v2, 0x7f020001

invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v2

aput-object v2, v0, v1

const/4 v1, 0x1

.line 24
const v2, 0x7f020002

invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v2

aput-object v2, v0, v1

const/4 v1, 0x2

.line 25
const v2, 0x7f020003

invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

move-result-object v2

aput-object v2, v0, v1

iput-object v0, p0, Lcom/grigview/MainActivity;->mImageIds:[Ljava/lang/Integer;

.line 16
return-void
.end method

.method static synthetic access$0(Lcom/grigview/MainActivity;)Landroid/widget/ImageView;
.locals 1
.parameter

.prologue
.line 18
iget-object v0, p0, Lcom/grigview/MainActivity;->image:Landroid/widget/ImageView;

return-object v0
.end method

.method static synthetic access$1(Lcom/grigview/MainActivity;)[Ljava/lang/Integer;
.locals 1
.parameter

.prologue
.line 22
iget-object v0, p0, Lcom/grigview/MainActivity;->mImageIds:[Ljava/lang/Integer;

return-object v0
.end method

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

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

.line 32
const/high16 v0, 0x7f03

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

.line 34
const/high16 v0, 0x7f08

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

move-result-object v0

check-cast v0, Landroid/widget/ImageView;

iput-object v0, p0, Lcom/grigview/MainActivity;->image:Landroid/widget/ImageView;

.line 36
iget-object v0, p0, Lcom/grigview/MainActivity;->image:Landroid/widget/ImageView;

new-instance v1, Lcom/grigview/MainActivity$1;

invoke-direct {v1, p0}, Lcom/grigview/MainActivity$1;-><init>(Lcom/grigview/MainActivity;)V

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

.line 54
return-void
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
.locals 2
.parameter "menu"

.prologue
.line 59
invoke-virtual {p0}, Lcom/grigview/MainActivity;->getMenuInflater()Landroid/view/MenuInflater;

move-result-object v0

const/high16 v1, 0x7f07

invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

.line 60
const/4 v0, 0x1

return v0
.end method

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

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

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Lcom/grigview/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/grigview/MainActivity;

# direct methods
.method constructor <init>(Lcom/grigview/MainActivity;)V
.locals 0
.parameter

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

.line 36
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 5
.parameter "v"
.parameter "event"

.prologue
const/4 v0, 0x1

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

move-result v1

if-nez v1, :cond_0

.line 41
iget-object v1, p0, Lcom/grigview/MainActivity$1;->this$0:Lcom/grigview/MainActivity;

#getter for: Lcom/grigview/MainActivity;->image:Landroid/widget/ImageView;
invoke-static {v1}, Lcom/grigview/MainActivity;->access$0(Lcom/grigview/MainActivity;)Landroid/widget/ImageView;

move-result-object v1

iget-object v2, p0, Lcom/grigview/MainActivity$1;->this$0:Lcom/grigview/MainActivity;

#getter for: Lcom/grigview/MainActivity;->mImageIds:[Ljava/lang/Integer;
invoke-static {v2}, Lcom/grigview/MainActivity;->access$1(Lcom/grigview/MainActivity;)[Ljava/lang/Integer;

move-result-object v2

iget-object v3, p0, Lcom/grigview/MainActivity$1;->this$0:Lcom/grigview/MainActivity;

iget-object v3, v3, Lcom/grigview/MainActivity;->rand:Ljava/util/Random;

iget-object v4, p0, Lcom/grigview/MainActivity$1;->this$0:Lcom/grigview/MainActivity;

#getter for: Lcom/grigview/MainActivity;->mImageIds:[Ljava/lang/Integer;
invoke-static {v4}, Lcom/grigview/MainActivity;->access$1(Lcom/grigview/MainActivity;)[Ljava/lang/Integer;

move-result-object v4

array-length v4, v4

invoke-virtual {v3, v4}, Ljava/util/Random;->nextInt(I)I

move-result v3

aget-object v2, v2, v3

invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

move-result v2

invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setBackgroundResource(I)V

.line 47
:goto_0
return v0

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

move-result v1

if-ne v1, v0, :cond_1

.line 44
iget-object v1, p0, Lcom/grigview/MainActivity$1;->this$0:Lcom/grigview/MainActivity;

#getter for: Lcom/grigview/MainActivity;->image:Landroid/widget/ImageView;
invoke-static {v1}, Lcom/grigview/MainActivity;->access$0(Lcom/grigview/MainActivity;)Landroid/widget/ImageView;

move-result-object v1

const/high16 v2, 0x7f02

invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setBackgroundResource(I)V

goto :goto_0

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

goto :goto_0
.end method

first step i tried to write the method with random code

.method public randomimage();
.locals 5

.prologue
.line 20
new-instance v0, Ljava/util/Random;

invoke-direct {v0}, Ljava/util/Random;-><init>()V

.line 22
.local v0, rand:Ljava/util/Random;
const/4 v0, 0x1

move-result-object v4

array-length v4, v4

invoke-virtual {v0, v4}, Ljava/util/Random;->nextInt(I)I

move-result v3

aget-object v2, v2, v3

invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

move-result v2

invoke-virtual {v1, v2}, Landroid/widget/ImageView;->setBackgroundResource(I)V

.line 16
return-void
.end method

of course i think it isn't right, so i need your help:p

thanks in advance