团子の小屋

【技术分享】跳activity界面代码

使用原理:结束当前界面,进入新的界面
用途:可用作跳启动页


方法名

.method private jumpToActivity()V
    .registers 3

    .line 424
    new-instance v0, Landroid/content/Intent;
#const-class v1, Lcom/kele/kelecloud/MainActivity;这句代码里面Lcom/kele/kelecloud/MainActivity换成你要跳转到的activity的路径
    const-class v1, Lcom/kele/kelecloud/MainActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 425
    .local v0, "mIntent":Landroid/content/Intent;
    invoke-virtual {p0, v0}, Lcom/kele/kelecloud/LoginActivity;->startActivity(Landroid/content/Intent;)V
#上面的Lcom/kele/kelecloud/LoginActivity换成本界面的activity路径
    .line 426
    invoke-virtual {p0}, Lcom/kele/kelecloud/LoginActivity;->finish()V
#上面的Lcom/kele/kelecloud/LoginActivity换成本界面的activity路径
    .line 427
    return-void
.end method

调用码,放在oncreate里面的return结束代码上面一行

#Landroid/content/Intent换成当前路径
invoke-direct {p0}, Landroid/content/Intent;->jumpToActivity()V

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »