Showing posts with label alert. Show all posts
Showing posts with label alert. Show all posts

Dismiss UIAlertViews or UIActionSheet When Enter Background State

- (void)checkViews:(NSArray *)subviews {
    Class AVClass = [UIAlertView class];
    Class ASClass = [UIActionSheet class];
    for (UIView * subview in subviews){
        if ([subview isKindOfClass:AVClass]){
            [(UIAlertView *)subview dismissWithClickedButtonIndex:[(UIAlertView *)subview cancelButtonIndex] animated:NO];
        } else if ([subview isKindOfClass:ASClass]){
            [(UIActionSheet *)subview dismissWithClickedButtonIndex:[(UIActionSheet *)subview cancelButtonIndex] animated:NO];
        } else {
            [self checkViews:subview.subviews];
        }
    }
}

Calling it from the applicationDidEnterBackground procedure

[self checkViews:application.windows];

Full Screen Dialog


final Dialog instructionDialog = new Dialog(getParent(), android.R.style.Theme);
instructionDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
instructionDialog.setContentView(getLayoutInflater().inflate(R.layout.dialog_instruction
       , null));
instructionDialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
Button btn = (Button) instructionDialog.findViewById(R.id.btn_instruction);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
instructionDialog.dismiss();
}
});
instructionDialog.show();

Build push notification with urban airship

http://mobile.tutsplus.com/tutorials/iphone/iphone-sdk_apns/

Custom Alertview

http://iphonedevelopment.blogspot.sg/2010/05/custom-alert-views.html