Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HomeFragment extends Fragment {
- ImageButton define;
- Context context;
- LayoutInflater layoutInflater;
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- // return inflater.inflate(R.layout.fragment_home, container, false);
- layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = layoutInflater.inflate(R.layout.fragment_home, container, false);
- Button define = view.findViewById(R.id.define);
- define.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent inent = new Intent(context, Define.class);
- context.startActivity(inent);
- }
- });
- return inflater.inflate(R.layout.fragment_home, container, false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment