即时尝试从一个活动到另一个一次发送两个捆绑,即时通讯没有运气..我可以发送捆绑确定,但是当我尝试两个发送两个我得到一个空指针。 继承人我的代码:立即发送多个包
Activity A,
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TextView name = (TextView) v.findViewById(R.id.label2);
TextView number1 = (TextView) v.findViewById(R.id.label);
Intent i = new Intent(this, options_Page.class);
// Bundle bundle2 = new Bundle();
Bundle bundle1 = new Bundle();
bundle1.putString("title", number1.getText().toString());
// bundle2.putString("title2", name.getText().toString());
i.putExtras(bundle1);
// i.putExtras(bundle2);
startActivity(i);
Activity B,
Bundle bundle1 = this.getIntent().getExtras();
// Bundle bundle2 = this.getIntent().getExtras();
String title = bundle1.getString("title");
// String title2 = bundle2.getString("title2");
((TextView) findViewById(R.id.tvnumber)).setText(title);
// ((TextView) findViewById(R.id.tvname)).setText(title2);
使用此代码,因为它是现在它发送一个包(数量)没有问题,如果有人知道我怎么可以给对方(名称),将真正帮助我。 在此先感谢...
你为什么要2包? – user370305
即时通讯不知道是否需要两个捆绑,我必须在列表中的一个活动名称和编号,我需要发送到另一个活动。谢谢 – steo