Intent跳转传值取值

存值

       Intent intent = new Intent(context, DiseaseActivity.class);
       intent.putExtra("name",resultBean.getName());
       intent.putExtra("id",resultBean.getId());
       context.startActivity(intent);

取值

        int id = getIntent().getIntExtra("id", 0);
        String name = getIntent().getStringExtra("name");

你可能感兴趣的:(Intent跳转传值取值)