Android Open Source - fragments Frag Mid






From Project

Back to project page fragments.

License

The source code is released under:

GNU General Public License

If you think the Android project fragments listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package edu.cs4730.frag6demo;
/* w  ww  .  ja  v a2s .c  o m*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

public class FragMid extends Fragment implements Button.OnClickListener {
  Button btn_lt, btn_rt;
  EditText et;
  MainActivity parent;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
  }

  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    
    View view = inflater.inflate(R.layout.middle, container, false);
    btn_lt = (Button) view.findViewById(R.id.btn_lt);
    btn_lt.setOnClickListener(this);
    btn_rt = (Button) view.findViewById(R.id.btn_rt);
    btn_rt.setOnClickListener(this);
    et = (EditText) view.findViewById(R.id.editText1);
    parent = (MainActivity)getActivity();
    
    return view;
  }

  @Override
  public void onClick(View v) {
    if (v == btn_lt) { //left button
      parent.leftfrag.setText(et.getText().toString());
    } else {  //right button
      parent.rightfrag.setText(et.getText().toString());
    }
    et.setText("");
  }
}




Java Source Code List

com.example.frag7demo.MainActivity.java
com.example.frag7demo.MainActivity.java
edu.cs4730.frag1demo.Fd1.java
edu.cs4730.frag1demo.Fd1.java
edu.cs4730.frag1demo.Fd1.java
edu.cs4730.frag1demo.Fd1.java
edu.cs4730.frag1demo.Shakespeare.java
edu.cs4730.frag1demo.Shakespeare.java
edu.cs4730.frag1demo.Shakespeare.java
edu.cs4730.frag1demo.Shakespeare.java
edu.cs4730.frag1demo.textFrag.java
edu.cs4730.frag1demo.textFrag.java
edu.cs4730.frag1demo.textFrag.java
edu.cs4730.frag1demo.textFrag.java
edu.cs4730.frag1demo.titlefrag.java
edu.cs4730.frag1demo.titlefrag.java
edu.cs4730.frag1demo.titlefrag.java
edu.cs4730.frag1demo.titlefrag.java
edu.cs4730.frag2demo.Fd2.java
edu.cs4730.frag2demo.Fd2.java
edu.cs4730.frag2demo.Fd2v11.java
edu.cs4730.frag2demo.Fd2v11.java
edu.cs4730.frag2demo.Shakespeare.java
edu.cs4730.frag2demo.Shakespeare.java
edu.cs4730.frag2demo.Shakespeare.java
edu.cs4730.frag2demo.Shakespeare.java
edu.cs4730.frag2demo.textActivity.java
edu.cs4730.frag2demo.textActivity.java
edu.cs4730.frag2demo.textActivity.java
edu.cs4730.frag2demo.textActivity.java
edu.cs4730.frag2demo.textFrag.java
edu.cs4730.frag2demo.textFrag.java
edu.cs4730.frag2demo.textFrag.java
edu.cs4730.frag2demo.textFrag.java
edu.cs4730.frag2demo.titlefrag.java
edu.cs4730.frag2demo.titlefrag.java
edu.cs4730.frag2demo.titlefrag.java
edu.cs4730.frag2demo.titlefrag.java
edu.cs4730.frag3demo.MainActivity.java
edu.cs4730.frag3demo.MainActivity.java
edu.cs4730.frag3demo.Shakespeare.java
edu.cs4730.frag3demo.Shakespeare.java
edu.cs4730.frag3demo.textFrag.java
edu.cs4730.frag3demo.textFrag.java
edu.cs4730.frag3demo.titlefrag.java
edu.cs4730.frag3demo.titlefrag.java
edu.cs4730.frag4demo.MainActivity.java
edu.cs4730.frag4demo.MainActivity.java
edu.cs4730.frag4demo.OneFragment.java
edu.cs4730.frag4demo.OneFragment.java
edu.cs4730.frag4demo.TwoFragment.java
edu.cs4730.frag4demo.TwoFragment.java
edu.cs4730.frag6demo.FragLeft.java
edu.cs4730.frag6demo.FragLeft.java
edu.cs4730.frag6demo.FragMid.java
edu.cs4730.frag6demo.FragMid.java
edu.cs4730.frag6demo.FragRight.java
edu.cs4730.frag6demo.FragRight.java
edu.cs4730.frag6demo.MainActivity.java
edu.cs4730.frag6demo.MainActivity.java
edu.cs4730.fragcomdemo.FirstFragment.java
edu.cs4730.fragcomdemo.FirstFragment.java
edu.cs4730.fragcomdemo.MainActivity.java
edu.cs4730.fragcomdemo.MainActivity.java
edu.cs4730.fragcomdemo.MainFragment.java
edu.cs4730.fragcomdemo.MainFragment.java
edu.cs4730.fragcomdemo.SecondFragment.java
edu.cs4730.fragcomdemo.SecondFragment.java