I want to start new Intent only if the previous one is finished, how can I do it..
here I want to goto purchase window if i am already registered, if I am not, then i should be there on Registration page. after finishing registration by clicking register button the purchase window should come.
now both activities starting!!!
if (!registered) {
//goto registration window
new MainActivity().registerUser(getContext());
}
//goto book purchase window
new MainActivity().showPurchaseWinsow(getContext());
}
the registeruser() method is:
public void registerUser(Context context) {
Intent registerUser = new Intent(context, RegisterUser.class);
context.startActivity(registerUser);
}
the showPurchaseWindow is
public void showPurchaseWinsow(Context context) {
Intent purchaseBook = new Intent(context, BookPurchaseMain.class);
context.startActivity(purchaseBook);
}
whats wrong with it....any help please.. How can I start the purchaseWindow only after finishing the registration window.