public class RootClassActivity extends Activity {
public void goToNextPagePress(View view) {
Intent intent = new Intent();
intent.setClass(RootClassActivity.this, NodeClassActivity.class);
intent.putExtra("type", 0);
Bundle bundle = new Bundle();
bundle.putInt("value", 1);
intent.putExtras(bundle);
startActivity(intent);
}
}
NodeClassActivity :
public void goToNextPagePress(View view) {
Intent intent = new Intent();
intent.setClass(RootClassActivity.this, NodeClassActivity.class);
intent.putExtra("type", 0);
Bundle bundle = new Bundle();
bundle.putInt("value", 1);
intent.putExtras(bundle);
startActivity(intent);
}
}
public class NodeClassActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = this.getIntent();
int type = intent.getIntExtra("type", 0);
Bundle bundle = intent.getExtras();
int value = bundle.getInt("value");
}
public void backBtnPress(View view) {
NodeClassActivity.this.finish();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = this.getIntent();
int type = intent.getIntExtra("type", 0);
Bundle bundle = intent.getExtras();
int value = bundle.getInt("value");
}
public void backBtnPress(View view) {
NodeClassActivity.this.finish();
}
}
沒有留言:
張貼留言