You could use SharePreference to store the state whether or not user have viewed your instruction. Just add a boolean value named as 'instructionViewed' to SharePreference. Every time your application launched, check the value. If true, don't show instruction. If false, show instruction. When user click the cancel button, set the value to true.
SharePreference is a very easy-using class to help store some information.You could google how use it.
Hope this helpful.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.testpage);
//Check SharePreference
boolean instructionViewed = checkInstrunctionState();
//If the instruction is not viewed, show instruction.
if(!instructionViewed){
RelativeLayout yourLayout = createYourOwnUi();
FrameLayout contentView = (FrameLayout)(getWindow().getDecorView().findViewById(android.R.id.content));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(MATCH_PARENT,MATCH_PARENT);
contentView.addView(yourLayout, lp);
}
}