如何使用android编码将按钮从一页移动到另一页 [英] how to move the buttons from one page to another using android codings

查看:78
本文介绍了如何使用android编码将按钮从一页移动到另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用android编码将按钮从一页移动到另一页

how to move the buttons from one page to another using android codings

推荐答案

将活动添加到AndroidManifest.xml后,必须使用startintenet方法
you have to use startintenet method after you add your activity to your AndroidManifest.xml
<pre lang="xml"><activity android:name=".ListViewExampleActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>



然后您可以在按钮上单击:



then you can use on buttonclick the :

Button orderButton = (Button)findViewById(R.id.order);
orderButton.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View view) {
    Intent intent = new Intent(FirstActivity.this, OrderScreen.class);
    startActivity(intent);
  }
});


问候...


regards...


这篇关于如何使用android编码将按钮从一页移动到另一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆