I tried making a navigation between fragments. I've got the NewFragment.java
with the new fragment working. My problem is:
How do I make this onClickListener
run NewFragment.java
correctly?
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getActivity(), NewFragment.class);
startActivity(i);
}
});
FYI: This is from inside a fragment (I don't know if that matters).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…