Advertisement
Guest User

rrrr

a guest
Jul 18th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package shahi.lifecycle.android.com.tablayoutexample;
  2.  
  3. import android.content.Context;
  4. import android.os.Bundle;
  5. import android.support.annotation.NonNull;
  6. import android.support.annotation.Nullable;
  7. import android.support.v4.app.Fragment;
  8. import android.view.LayoutInflater;
  9. import android.view.View;
  10. import android.view.ViewGroup;
  11. import android.widget.Button;
  12.  
  13. public class FragmentOne extends Fragment{
  14.  
  15. iDataSend send;
  16. Button btn;
  17. @Nullable
  18. @Override
  19. public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
  20. View view = inflater.inflate(R.layout.fragment_one,container,false);
  21. btn.findViewById(R.id.buttonNext);
  22. btn.setOnClickListener(new View.OnClickListener() {
  23. @Override
  24. public void onClick(View v) {
  25. send.send(1);
  26. }
  27. });
  28. return view;
  29. }
  30.  
  31. public void onAttach(Context context)
  32. {
  33. super.onAttach(context);
  34. send=(iDataSend)context;
  35. }
  36.  
  37. interface iDataSend{
  38.  
  39.  
  40.  
  41. public void send (int value);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement