Advertisement
Guest User

Untitled

a guest
May 25th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package androidhive.info.materialdesign.activity;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.support.v4.app.Fragment;
  6. import android.view.LayoutInflater;
  7. import android.view.View;
  8. import android.view.ViewGroup;
  9. import android.widget.Button;
  10. import android.widget.Toast;
  11.  
  12. import androidhive.info.materialdesign.R;
  13.  
  14. /**
  15. * A placeholder fragment containing a simple view.
  16. */
  17. public class CreateFragmentFragment extends Fragment
  18. implements View.OnClickListener
  19. {
  20.  
  21. public CreateFragmentFragment()
  22. {
  23. }
  24. public void onCreate(Bundle savedInstanceState) {
  25. super.onCreate(savedInstanceState);
  26.  
  27.  
  28. }
  29.  
  30.  
  31.  
  32. @Override
  33. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  34. Bundle savedInstanceState) {
  35. View view = inflater.inflate(R.layout.fragment_create, container, false);
  36. final Button button =
  37. (Button) view.findViewById(R.id.Submit);
  38. button.setOnClickListener(this);
  39.  
  40. return view;
  41.  
  42. }
  43. public void onAttach(Activity activity) {
  44. super.onAttach(activity);
  45.  
  46. }
  47.  
  48. @Override
  49. public void onDetach() {
  50. super.onDetach();
  51. }
  52.  
  53.  
  54. @Override
  55. public void onClick(View v) {
  56. Toast.makeText(this.getActivity(),
  57. "Button is clicked!", Toast.LENGTH_LONG).show();
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement