Fragment消息的交互
代码说明:
package com.fragment.demo3;import android.app.Fragment;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.TextView;public class Fragment2 extends Fragment {private TextView text;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fragment2, null);text = (TextView) view.findViewById(R.id.textView1);return view;}public void setText(String setText) {text.setText(setText);}}
下载说明:请别用迅雷下载,失败请重下,重下不扣分!