S
S
Semyon Novikov2016-01-30 14:10:14
Android
Semyon Novikov, 2016-01-30 14:10:14

How to make a transition from a fragment to an activity using a button?

I have a snippet:

public class ScreenTwo extends Fragment {

    public ScreenTwo() {
    }


    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.screen_two, container,
                false);
        return rootView;
    }
}

Normal transition doesn't work:
public void Click(View view) {
        Intent intent=new Intent(ScreenTwo.this,mainclass.class);
        startActivity(intent);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2016-01-30
@semennovikov123

Could not find a method Click(View) in the activity class ssoft.sskaterpro.MainActivity for onClick handler on view class android.widget.Button with id 'button3'

well, live! there is no method.
you have to look at the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question