xml

  • activity_confirm
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent">    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="40dp"        android:background="#33000000">        <TextView            android:id="@+id/tvLeft"            android:layout_width="wrap_content"            android:layout_height="wrap_content" />        <Button            android:id="@+id/bt"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_alignParentRight="true"            android:background="#ff0000"            android:text="立即下单" />    RelativeLayout>LinearLayout>

view层

  • ConfirmActivity
public class ConfirmActivity extends AppCompatActivity implements View.OnClickListener {    private TextView mTvLeft;    private Button mBt;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_confirm);        //接收传过来实付款        Intent intent = getIntent();        String money = intent.getStringExtra("money");        initView();        mTvLeft.setText("实付款:¥" + money);    }    private void initView() {        mTvLeft = (TextView) findViewById(R.id.tvLeft);        mBt = (Button) findViewById(R.id.bt);        mBt.setOnClickListener(this);    }    @Override    public void onClick(View v) {        switch (v.getId()) {            default:                break;            case R.id.bt:                //跳转到订单页面                Intent intent = new Intent(ConfirmActivity.this, OrderActivity.class);                startActivity(intent);                break;        }    }

更多相关文章

  1. android (back)返回键监听
  2. Android接收程序安装、替换、卸载广播
  3. Android端的极光配置
  4. Android开机自启APK应用
  5. 系出名门Android(4) - 活动(Activity), 服务(Service), 广播(Bro
  6. android 进程间通信示例
  7. Android系统中的广播(Broadcast)机制注册注销发送原理总结
  8. Android(安卓)push 极光通信
  9. Android系统中的广播(Broadcast)机制注册注销发送原理总结

随机推荐

  1. Android模拟器分辨率介绍
  2. android目标sdk版本
  3. Android 点击back键两次退出程序
  4. Android Studio第三十一期 - 记录Recycle
  5. 有需要免费视频的,Android ,IOS,H5,React Na
  6. Android动态获取存储权限
  7. android学习日志
  8. Android之——判断当前应用程序是否是用
  9. H5中利用canvas绘制video
  10. Android(安卓)SDK tools adb.exe下文件丢