sender

Android C2DM sender id

大城市里の小女人 提交于 2019-12-12 02:31:05
问题 I've been working with de C2DM for sometime and its has been working perfect. Recently I've bumped into a problem that I can't seem to fix and couldn't anything on this forum that might help. The problem is that I have several apps that use C2DM, I've let all apps register with the same sender id which then registers the users token in my database. The problem if a user has two of my apps A & B (same sender id) and launches app A and I send a push notification to users with app B, user who

Pass data with prepareForSegue

南楼画角 提交于 2019-12-11 03:37:05
问题 Im trying to pass data from viewController 1 to viewController2, I have 2 buttons and 1 segue(therefore there is one segue identifier) for those 2 buttons, each button when pressed should show: 1 label to show the title and 1 textView to show a definition, I am having troubles to show its own data of each word; I know it has to be the some code referencing the SENDER in the performSegueWithIdentifier, but I don't know how to do it. I appreciate your help !!! thanks. here is my code class

Get Safe sender list in Outlook 2007 C# Add in

亡梦爱人 提交于 2019-12-11 02:27:54
问题 I have created an Outlook 2007 add-in in C#.NET 4.0. I want to read the safe sender list in my C# code. if (oBoxItem is Outlook.MailItem) { Outlook.MailItem miEmail = (Outlook.MailItem)oBoxItem; OlDefaultFolders f = Outlook.OlDefaultFolders.olFolderContacts; if (miEmail != null) { string body = miEmail.Body; double score = spamFilterObject.CalculateSpamScore(body); if (score <= 0.9) { miEmail.Move(mfJunkEmail); } } } So, the above code moves all email to spam, even though they are present in

Error: “Cannot assign to immutable expression of type 'Bool'”?

本秂侑毒 提交于 2019-12-11 01:35:45
问题 How do I fix this? I'm a new coder. Thank you I get the follow error: "Cannot assign to immutable expression of type 'Bool'" When I try to set the "isSelected" to false and true @IBAction func onFilter(_ sender: Any) { if ((sender as AnyObject).isSelected == true) { hideSecondaryMenu() (sender as AnyObject).isSelected = false } else { showSecondaryMenu() (sender as AnyObject).isSelected = true } } 回答1: You are getting this error because when you are converting sender to AnyObject you are

android sms sender name returns null

六月ゝ 毕业季﹏ 提交于 2019-12-11 01:35:41
问题 Greetings. I am trying to read the sms sender name using the following code. The variable name is always null. Please let me know what is the problem with code. It returns address properly But the name is null ContentResolver contentResolver = getContentResolver(); Cursor mCursor = contentResolver.query( Uri.parse( "content://sms/inbox" ), null, null, null, null); if(mCursor.getCount()==0) return; startManagingCursor(mCursor); mCursor.moveToFirst(); String fromadd = mCursor.getString(mCursor

How to get button.tag via longPressGestureRecognizer?

南楼画角 提交于 2019-12-10 15:15:53
问题 I'm dynamically adding image buttons to some scrollview. They all point at one longPressHandler. Now, how do I get which button was pressed? The [sender tag] gives me the tag of longGestureRecognizer that I added to button and I can't manually set that tag. for (...) { UIButton *button = [[UIButton alloc] init]; button.tag = w + h * 3; [button addTarget:self action:@selector(imageButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; UILongPressGestureRecognizer *gest = [

multiple signals for one slot

折月煮酒 提交于 2019-12-10 11:04:19
问题 For my GUI i would like to have two pairs of buttons that scroll up and down a scrollarea. The first set of buttons should work on say scrollarea1 and the second set of buttons should work on a scrollarea2. The widgets that I put in the scrollarea are called viewport1 and viewport2. Since both both set of buttons should do the same (scrolling up and down) I thought I would make two slots called scrollUp and scrollDown that would handle the scrolling for both sets of buttons. Unfortunately I

How to use “Sender” parameter with “As” operator for more then one class at a time?

橙三吉。 提交于 2019-12-09 06:42:43
问题 In Delphi, sometimes we need to do this... function TForm1.EDIT_Click(Sender: TObject); begin (Sender As TEdit).Text := ''; end; ...but sometimes we need to repeat the function with other object class like... function TForm1.COMBOBOX_Click(Sender: TObject); begin (Sender As TComboBox).Text := ''; end; ...because the operator As does not accept flexibility. It must know the class in order to allow the .Text that come after the () . Sometimes the code gets full of similar functions and

PySide QtCore.Slot decorator does not work with self.sender() inside a method

依然范特西╮ 提交于 2019-12-08 11:20:50
问题 I came across this weirdness in using PySide Slot decorator. If I decorate my method using QtCore.Slot and if I try to access self.sender() inside the method, I get None. If I remove the QtCore.Slot() decorator. I get the sender properly. Here is a minimal example. import sys from PySide.QtCore import * from PySide.QtGui import * class Worker(QObject): def init(self): print "worker is ready." @Slot() def work(self): print "i am tired, %s" % self.sender() app = QApplication(sys.argv) button =

How to get which button is clicked?

旧巷老猫 提交于 2019-12-06 07:03:22
问题 I want to check some condition when a particular button is clicked how to do this? $(document).ready(function () { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest); Search("Other"); }); function InitializeRequest(sender, args) { } function EndRequest(sender, args) { alert(sender._postBackSettings.sourceElement.id) var str1 = new String(sender._postBackSettings.sourceElement.id); if (sender._postBackSettings