Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package shahi.lifecycle.android.com.tablayoutexample;
- import android.content.Context;
- import android.os.Bundle;
- import android.support.annotation.NonNull;
- import android.support.annotation.Nullable;
- import android.support.v4.app.Fragment;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.Button;
- public class FragmentOne extends Fragment{
- iDataSend send;
- Button btn;
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment_one,container,false);
- btn.findViewById(R.id.buttonNext);
- btn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- send.send(1);
- }
- });
- return view;
- }
- public void onAttach(Context context)
- {
- super.onAttach(context);
- send=(iDataSend)context;
- }
- interface iDataSend{
- public void send (int value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement