本文主要是介绍Android Handler不同界面发送数据,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
发送端界面:
Bundle bundle = new Bundle();bundle.putString("introduce", "啊啊啊啊啊");Message message = CompletePartnerInformationFragment.completePartnerInfHandler.obtainMessage();message.what = Constants.MessageWhat.WHAT_REFRESH_PARTNER_INTRODUCE;message.setData(bundle);message.sendToTarget();
接收界面:
private void initHandler(){completePartnerInfHandler = new Handler(){@Overridepublic void handleMessage(Message msg) {super.handleMessage(msg);switch (msg.what) {case Constants.MessageWhat.WHAT_REFRESH_PARTNER_INTRODUCE:Bundle bundle = msg.getData();String introduce = bundle.getString("introduce");introduceView.setText(introduce);break;default:break;}}};
这篇关于Android Handler不同界面发送数据的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!