dismiss

Notification is not being dismissed (Android)

送分小仙女□ 提交于 2019-12-01 18:22:43
Notification setAutoCancel(true) doesn't work if clicking on Action I have a notification with an action within it. When I tap on the notification it gets removed from the list. However, when I click on the Action it successfully completes the Action (namely makes a call), but when I return to the list of notifications, it remains there. Relative code of the AlarmReceiver: public class AlarmReceiver extends BroadcastReceiver { Meeting meeting; /** * Handle received notifications about meetings that are going to start */ @Override public void onReceive(Context context, Intent intent) { // Get

“Are you sure you want to leave this page?” functions for cancel and OK

℡╲_俬逩灬. 提交于 2019-12-01 12:09:11
问题 i'm trying to do something similar to some websites where you leave and it'll display a popup saying "Are you sure you want to leave this page" and with two options saying "Cancel" and "OK". How would I do that and make it so when you click "Cancel" it'll just cancel the box and when they click "OK" it'll do a 'leaveChat();' function and leave the website? I've tried using the onbeforeunload which was working but i'm not sure on the function part. Thanks for the help! 回答1: There is no way to

Android swipe layout to dismiss

故事扮演 提交于 2019-12-01 04:51:54
问题 I'm trying to make a swipeable layout so you can swipe it to dismiss like in Google now. I managed to getting it worked on a view such as button using this codes: SwipeDismissTouchListener: public class SwipeDismissTouchListener implements View.OnTouchListener { // Cached ViewConfiguration and system-wide constant values private int mSlop; private int mMinFlingVelocity; private int mMaxFlingVelocity; private long mAnimationTime; // Fixed properties private View mView; private DismissCallbacks

Adding Done Button to Only Number Pad Keyboard on iPhone

て烟熏妆下的殇ゞ 提交于 2019-12-01 00:07:28
I am successfully adding a done button to my number pad with this handy code below. But I have an email button that launches the MFMailComposeViewController. How would I make sure the done button does not appear on the email keyboard? // // UIViewController+NumPadReturn.m // iGenerateRandomNumbers // // Created by on 12/4/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "UIViewController+NumPadReturn.h" @implementation UIViewController (NumPadReturn) -(void) viewDidLoad{ // add observer for the respective notifications (depending on the os version) if ([[[UIDevice

Pass value to parent controller when dismiss the controller

旧城冷巷雨未停 提交于 2019-11-30 17:41:40
问题 I want to send data to parentviewcontroller but the following code crashes. Give me the solution Post *vc; vc.abc =@"Comment Conttroller"; [self.parentViewController dismissModalViewControllerAnimated:YES]; Here, Post is the controller name from where I am calling the presentViewController:animated:completion method. 回答1: vc doesn't seem to be initialized. You can probably do this, vc = (Post *)self.parentViewController; vc.abc = @"Comment Conttroller"; [vc dismissModalViewControllerAnimated

dismissModalViewControllerAnimated: (and dismissViewControllerAnimated) crashing in iOS 5

徘徊边缘 提交于 2019-11-30 14:07:47
问题 I can't find any logical explanation, but the fact remains that, in iOS 5 (xCode 4.2), if I presentModalView:* animated:YES, I can call dismissModalViewAnimated:* fine, but if I call presentModalView:* animated:NO, then calling the dismiss method crashes. (This works the same if I use the new presentViewController:animated:completion: + dismissViewControllerAnimated:). I am going TRY to work around this for now (I don't want the presentation animated) and report a bug to Apple, but I have

is there a way NOT to have the popover dismissed when pressing outside it?

喜夏-厌秋 提交于 2019-11-30 13:03:39
问题 I know the SDK documentation says Taps outside of the popover’s contents automatically dismiss the popover. But I'm sure the smart people here found a way :) maybe I should overwrite the popover dismiss function? Thanks EDIT: I tried using the passthroughViews as was suggested here, and it works perfectly. Here's the code for whoever needs it - in this example, I put self.view in the array, which means that where ever outside the button where the popover was originated, nothing dismiss the

dismissModalViewControllerAnimated: (and dismissViewControllerAnimated) crashing in iOS 5

不问归期 提交于 2019-11-30 09:12:12
I can't find any logical explanation, but the fact remains that, in iOS 5 (xCode 4.2), if I presentModalView:* animated:YES, I can call dismissModalViewAnimated:* fine, but if I call presentModalView:* animated:NO, then calling the dismiss method crashes. (This works the same if I use the new presentViewController:animated:completion: + dismissViewControllerAnimated:). I am going TRY to work around this for now (I don't want the presentation animated) and report a bug to Apple, but I have been beating my head on this for a while. Any and all suggestions are welcome. Not much out there on iOS 5

FloatingActionButton does not come down when dismissing Snackbar

我的梦境 提交于 2019-11-30 08:50:12
I am trying to use a Snackbar . I have a FloatingActionButton wrapped in a CoordinatorLayout . When the Snackbar shows, the button is correctly moved up. When it dismisses automatically, the button moves down. But if I dismiss the Snackbar programmatically, the button does not go down. My code is simple: mSnackbar = Snackbar.make(mCoordinatorLayout, text, Snackbar.LENGTH_LONG) .setAction(R.string.undo, new View.OnClickListener() { @Override public void onClick(View v) { undoDeleteTasks(); } }); mSnackbar.show(); Is there a way to make the FloatingActionButton move down when the Snackbar is

How to dismiss AlertDialog.Builder?

流过昼夜 提交于 2019-11-30 07:58:49
In the following code below, how do I dismiss the alert box? I don't want to cause a memory leak. I tried the .dismiss() on alertDialog, but that didn't work... Thanks // User pressed the stop button public void StopMsg_button_action(View view){ final EditText password_input = new EditText(this); // create an text input field password_input.setHint("Enter Password"); // put a hint in it password_input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); // change it to password type AlertDialog.Builder alertDialog = new Builder(this); // create an alert box