android - 确认订单页面【仿】京东App
16lz
2021-12-04
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; } }
更多相关文章
- android (back)返回键监听
- Android接收程序安装、替换、卸载广播
- Android端的极光配置
- Android开机自启APK应用
- 系出名门Android(4) - 活动(Activity), 服务(Service), 广播(Bro
- android 进程间通信示例
- Android系统中的广播(Broadcast)机制注册注销发送原理总结
- Android(安卓)push 极光通信
- Android系统中的广播(Broadcast)机制注册注销发送原理总结