Search Results

Search found 4925 results on 197 pages for 'proximity alert'.

Page 9/197 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Android Alert Dialog Extract User Choice Radio Button?

    - by kel196
    Apologies for any coding ignorance, I am a beginner and am still learning! I am creating a quiz app which reads questions off a SQL database and plots them as points on a google map. As the user clicks each point, an alert dialog appears with radio buttons to answer some question. My radiobuttons are in CustomItemizedOverlay file and when I click submit, I want to be able to send the user choice back to the database, save it and return to the user if their answer is correct. My question is this, how do I pass the user choice out once the submit button has been clicked? I tried making a global variable to read what was selected to no avail. Any suggestions would be appreciated! If I need to post any other code, please ask and I will do so ASAP! package uk.ac.ucl.cege.cegeg077.uceskkw; import java.util.ArrayList; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.graphics.drawable.Drawable; import android.widget.Toast; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.OverlayItem; public class CustomItemizedOverlay2 extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> mapOverlays = new ArrayList<OverlayItem>(); private Context context; public CustomItemizedOverlay2(Drawable defaultMarker) { super(boundCenterBottom(defaultMarker)); } public CustomItemizedOverlay2(Drawable defaultMarker, Context context) { this(defaultMarker); this.context = context; } @Override protected OverlayItem createItem(int i) { return mapOverlays.get(i); } @Override public int size() { return mapOverlays.size(); } @Override protected boolean onTap(int index) { OverlayItem item = mapOverlays.get(index); // gets the snippet from ParseKMLAndDisplayOnMap and splits it back into // a string. final CharSequence allanswers[] = item.getSnippet().split("::"); AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setIcon(R.drawable.easterbunnyegg); dialog.setTitle(item.getTitle()); dialog.setSingleChoiceItems(allanswers, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { Toast.makeText(context, "You have selected " + allanswers[whichButton], Toast.LENGTH_SHORT).show(); } }); dialog.setPositiveButton(R.string.button_submit, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); // int selectedPosition = ((AlertDialog) // dialog).getListView().getCheckedItemPosition(); Toast.makeText(context, "hi!", Toast.LENGTH_SHORT) .show(); } }); dialog.setNegativeButton(R.string.button_close, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); // on cancel button action } }); AlertDialog question = dialog.create(); question.show(); return true; } public void addOverlay(OverlayItem overlay) { mapOverlays.add(overlay); this.populate(); } }

    Read the article

  • OpenSSL in C++ email client - server closes connection with TLSv1 Alert message

    - by mice
    My app connects to a IMAP email server. One client configured his server to reject SSLv2 certificates, and now my app fails to connect to the server. All other email clients connect to this server successfully. My app uses openssl. I debugged by creating minimal openssl client and attempt to connect to the server. Below is the code with connects to the mail server (using Windows sockets, but same problem is with unix sockets). Server sends its initial IMAP greeting message, but after client sends 1st command, server closes connection. In Wireshark, I see that after sending command to server, it returns TLSv1 error message 21 (Encrypted Alert) and connection is gone. I'm looking for proper setup of OpenSSL for this connection to succeed. Thanks #include <stdio.h> #include <memory.h> #include <errno.h> #include <sys/types.h> #include <winsock2.h> #include <openssl/crypto.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/ssl.h> #include <openssl/err.h> #define CHK_NULL(x) if((x)==NULL) exit(1) #define CHK_ERR(err,s) if((err)==-1) { perror(s); exit(1); } #define CHK_SSL(err) if((err)==-1) { ERR_print_errors_fp(stderr); exit(2); } SSL *ssl; char buf[4096]; void write(const char *s){ int err = SSL_write(ssl, s, strlen(s)); printf("> %s\n", s); CHK_SSL(err); } void read(){ int n = SSL_read(ssl, buf, sizeof(buf) - 1); CHK_SSL(n); if(n==0){ printf("Finished\n"); exit(1); } buf[n] = 0; printf("%s\n", buf); } void main(){ int err=0; SSLeay_add_ssl_algorithms(); SSL_METHOD *meth = SSLv23_client_method(); SSL_load_error_strings(); SSL_CTX *ctx = SSL_CTX_new(meth); CHK_NULL(ctx); WSADATA data; WSAStartup(0x202, &data); int sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); CHK_ERR(sd, "socket"); struct sockaddr_in sa; memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_addr.s_addr = inet_addr("195.137.27.14"); sa.sin_port = htons(993); err = connect(sd,(struct sockaddr*) &sa, sizeof(sa)); CHK_ERR(err, "connect"); /* ----------------------------------------------- */ /* Now we have TCP connection. Start SSL negotiation. */ ssl = SSL_new(ctx); CHK_NULL(ssl); SSL_set_fd(ssl, sd); err = SSL_connect(ssl); CHK_SSL(err); // Following two steps are optional and not required for data exchange to be successful. /* printf("SSL connection using %s\n", SSL_get_cipher(ssl)); X509 *server_cert = SSL_get_peer_certificate(ssl); CHK_NULL(server_cert); printf("Server certificate:\n"); char *str = X509_NAME_oneline(X509_get_subject_name(server_cert),0,0); CHK_NULL(str); printf(" subject: %s\n", str); OPENSSL_free(str); str = X509_NAME_oneline(X509_get_issuer_name (server_cert),0,0); CHK_NULL(str); printf(" issuer: %s\n", str); OPENSSL_free(str); // We could do all sorts of certificate verification stuff here before deallocating the certificate. X509_free(server_cert); */ printf("\n\n"); read(); // get initial IMAP greeting write("1 CAPABILITY\r\n"); // send 1st command read(); // get reply to cmd; server closes connection here write("2 LOGIN a b\r\n"); read(); SSL_shutdown(ssl); closesocket(sd); SSL_free(ssl); SSL_CTX_free(ctx); }

    Read the article

  • AddProximityAlert Disappears Although Expiration -1

    - by Prasanna
    Hello, I want my app to have a proximityAlert until the user removes it. I use expiration -1 to create this proximityAlert. The proximityAlert works. But I find on my Droid phone, after adding a proximityAlert and leaving the phone over night for charging, the proximityAlert does not work the next day. How can I make sure that my proximityAlert is active indefinitely unless the user removes it? Thanks, Prasanna

    Read the article

  • What's wrong with this addProximity code?

    - by Pentium10
    I have this code: private void setupProximity() { Intent intent = new Intent(this, viewContacts.class); PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent, 0); LocationUtils.addProximity(this, -37.40, 144.55, 1000, 1000000, sender); } public static void addProximity(Context ctx,double lat, double lon, float rad,long exp, PendingIntent pintent) { LocationManager lm = (LocationManager) ctx.getSystemService(Context.LOCATION_SERVICE); lm.addProximityAlert(lat, lon, rad, exp, pintent); } Why I don't get the class to fire up? I am in the range of the zone.

    Read the article

  • Desktop Notifications, aka Internal Alert System

    - by Refracted Paladin
    It has become apparent that where I work needs, internally, a "notification system". The issue being that we are very spread out throughout multiple buildings and the bulk of the work force regularly keeps there email closed for hours at a time. I need to create a simple way to be able to push out a message and have it "pop up" on everyones computer(or a single computer). My first thought was to write a windows service that calls a winform/wpf app that resides on each computer that simply pops up with the message. Not sure how viable an idea that is but this is just brain-storming. A different route, I thought, could be an app that resides in the systray on each computer that polls a db table and using the Query Notifications could pop up a message each time a new row is added. Then simply create an insanely basic app for writing a row to that table. So, what I am asking is if any one else has walked this path. If so, how? What things did you take into consideration? Are either of my ideas valid starting points or are "egg and my face in perfect alignment"? Is there a different way that is even simpler? Thanks

    Read the article

  • Setting alarm's in linux to alert user

    - by Algorist
    Hi, I am running few tasks in my linux console and want to be notified by some kind of alarm, so I don't keep checking the progress of the task. Is there a way to customize the alarm by specifying additional filters like "ERROR" message etc..I think it will be a useful thing to have. Anyone aware of such functionality in linux? Thank you Bala

    Read the article

  • Javascript problem with a global external link confirmation alert

    - by OverDrive
    Below is the code from a plugin for Joomla. It works on it's own and it's purpose is to detect external links on the page and force them into new browser windows using _blank. I've tried for about an hour (I don't know javascript well) but I can't seem to figure out how to get an onclick function working. End result, I want to add to this script the ability of a confirmation dialog, shown in the 2nd code section. An external link, when clicked, will pop up the confirmation dialog, and if it says yes, they will be able to get to the external URL, opening in a new window. Otherwise, it cancels, and does nothing. When I create a link with onclick="return ExitNotice(this.href);" within it it works perfectly, but since my website has multiple people submitting input, I'd like the confirmation box global. this.blankwin = function(){ var hostname = window.location.hostname; hostname = hostname.replace("www.","").toLowerCase(); var a = document.getElementsByTagName("a"); this.check = function(obj){ var href = obj.href.toLowerCase(); return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false; }; this.set = function(obj){ obj.target = "_blank"; obj.className = "blank"; }; for (var i=0;i<a.length;i++){ if(check(a[i])) set(a[i]); }; }; this.addEvent = function(obj,type,fn){ if(obj.attachEvent){ obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn](window.event );} obj.attachEvent('on'+type, obj[type+fn]); } else { obj.addEventListener(type,fn,false); }; }; addEvent(window,"load",blankwin); Second Part /* ---------- OnClick External Link Notice ---------- */ function ExitNotice(link,site,ltext) { if(confirm("-----------------------------------------------------------------------\n\n" + "You're leaving the HelpingTeens.org website. HelpingTeens.org\ndoes not " + "control this site and its privacy policies may differ\nfrom our own. " + "Thank you for using our site.\n\nYou will now access the following link:\n" + "\n" + link + "\n\nPress \'OK\' to proceed, or press \'Cancel\' to remain here." + "\n\n-----------------------------------------------------------------------")) { return true; } history.go(0); return false; } A) Can anyone help me fix this problem? or B) Is there a better solution?

    Read the article

  • Show content with fancybox like a Javascript Alert

    - by Ron Lens
    I try to show the content from a PHP-file in a fancybox but I can't handle it. Now it's the following situation: If a file permission problem occures a <div id="error"> is shown on the website. I'd like to have the content from <div id="error"> in fancybox. Everything I try I get the notice "The requested content cannot be loaded. Please try again later." That means the fancybox, it the file permission error occures, should be shown when the page is loading and not like usual shown when some events like click or mouseover. For example, if the error exists, the following content should be shown in the fancybox: <div style="width:100px; height:100px; background:#f00;"> <p>Failure</p> </div> This snippet is located in a file security_check.php. Now there are two possibilities. The 1st is to load the security_check.php directly into the fancybox or to put in the mentioned above snippet. So: how to load file contents into the fancybox?

    Read the article

  • Alert team members of SVN commit?

    - by John
    I'm hosting my own svn repository on ubuntu 8.04. Is there a way for svn to send emails to team members whenever a commit has happened? If coding is required, the only language I'm able to use on a linux server is PHP. So I could write a php script to be triggered by svn. Can anyone tell me how to hook up my php script to an svn commit? Or is there another way to do this?

    Read the article

  • Possible to alert server to iphone settings change?

    - by DougW
    I'm working on giving our users context-specific PUSH notification settings, similar to what Facebook has in their settings menu. As far as I can tell though, there's no way to actually notify our server of these changes until the user actually launches the app. Is this correct? Is there any mechanism provided for immediately alerting our servers to a settings change?

    Read the article

  • The Stackoverflow alert box, How is it done?

    - by Scott
    Question says it all. Can someone point me to an example of how they do the alerts at the top when a new message arrives or someone posts to my answers or I just have a notification.. Thanks. P.s. I would love a JQUERY solution, but can work with just a js solution.

    Read the article

  • Given an even number of vertices, how to find an optimum set of pairs based on proximity?

    - by Alex Z
    The problem: We have a set of n vertices in 3D euclidean space, and there is an even number of these vertices. We want to pair them up based on their proximity. In other words, we'd like to be able to find a set of vertex pairs, where the vertices in each pair are as close as possible together. We want to minimise sacrificing the proximity between the vertices of any other pairs as much as possible in doing this. I am not looking for the most optimal solution (if it even strictly exists/can be done), just a reasonable one that can be computed relatively quickly. A relatively awful brute force approach involves choosing a vertex and looping through the rest to find its nearest neighbor and then repeating until there are none left. Of course as we near the end of the list the closest vertex could be very far away, but it is the only choice, therefore this can fail badly on the third point above.

    Read the article

  • How to change theme for AlertDialog.

    - by Min Soo Kim
    Hello everyone, I was wondering if someone could help me out. I am trying to create a custom AlertDialog. In order to do this, I added the following line of code in styles.xml @drawable/color_panel_background color_panel_background.9.png is located in drawable folder. This is also available in Android SDK res folder. The following is the main activity. package com.customdialog; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; public class CustomDialog extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.setTheme(R.style.CustomAlertDialog); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("HELLO!"); builder .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //MyActivity.this.finish(); } }) .setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //dialog.cancel(); } }); AlertDialog alertdialog = builder.create(); alertdialog.show(); } } In order to apply the theme to an AlertDialog, I had to set the theme to the current context. However, I just can't seem to get the app to show customized AlertDialog. Can anyone help me out with this, and thank you very much in advance!

    Read the article

  • becomeFirstResponder not working!!!

    - by vikinara
    In the below code becomeFirstResonder not working, only resignFirstresponder working...can anyone please help - (BOOL)textFieldShouldReturn:(UITextField *)textField { if (textField == txtDate) { [txtDate resignFirstResponder]; [txtTime becomeFirstResponder]; } if (textField == txtTime) { [txtTime resignFirstResponder]; [txtAddress becomeFirstResponder]; } if (textField == txtAddress) { [txtAddress resignFirstResponder]; [txtCity becomeFirstResponder]; } if (textField == txtCity) { [txtCity resignFirstResponder]; [txtState becomeFirstResponder]; } if(textField == txtState) { [txtState resignFirstResponder]; [txtZip becomeFirstResponder]; } if (textField == txtZip) { [txtZip resignFirstResponder]; } return NO; } - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { if(textField == txtDate) { NSString *dateString = txtDate.text; NSString *dateRegex = @"^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$"; NSPredicate *dateTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", dateRegex]; BOOL validateDate = [dateTest evaluateWithObject:dateString]; if(!validateDate){ UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Date Error." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtDate.text = nil; } } if(textField == txtTime) { NSString *timeString = txtTime.text; NSString *timeRegex = @"^(([0]?[0-5][0-9]|[0-9]):([0-5][0-9]))$"; NSPredicate *timeTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", timeRegex]; BOOL validateTime = [timeTest evaluateWithObject:timeString]; if(!validateTime) { UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Incorrect Time Entry." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtTime.text = nil; } } if(textField == txtAddress) { NSString *addressString = txtAddress.text; NSString *addressRegex = @"^[a-z0-9 ]+$"; NSPredicate *addressTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", addressRegex]; BOOL validateAddress = [addressTest evaluateWithObject:addressString]; if(!validateAddress) { UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Incorrect State." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtAddress.text = nil; } } if(textField == txtState) { NSString *stateString = txtState.text; NSString *stateRegex = @"^(?-i:A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; NSPredicate *stateTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", stateRegex]; BOOL validateState = [stateTest evaluateWithObject:stateString]; if(!validateState) { UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Incorrect State." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtState.text = nil; } } if(textField == txtCity) { NSString *cityString = txtCity.text; NSString *cityRegex = @"^[a-z ]+$"; NSPredicate *cityTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", cityRegex]; BOOL validateCity = [cityTest evaluateWithObject:cityString]; if(!validateCity) { UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Incorrect City." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtCity.text = nil; } } if(textField == txtZip) { NSString *zipString = txtZip.text; NSString *zipRegex = @"^[0-9]{5}([- /]?[0-9]{4})?$"; NSPredicate *zipTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", zipRegex]; BOOL validateZip = [zipTest evaluateWithObject:zipString]; if(!validateZip) { UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:nil message:@"Incorrect Zip." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert2 show]; [alert2 release]; txtZip.text = nil; } } return NO; }

    Read the article

  • Android: How to set the maximum size of a Spinner?

    - by Epaga
    Here is my layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:id="@+id/LinearLayout01" android:layout_height="wrap_content"> <Spinner android:text="@+id/AutoCompleteTextView01" android:id="@+id/Spinner01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:width="130dp"></Spinner> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/Chapter" android:width="30dp"></EditText> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/TextView01" android:text=":"></TextView> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/Verse" android:width="40dp"></EditText> </LinearLayout> I inflate this layout as an AlertDialog's view. But when I pick a large element, the text fields get pushed out to the right. Is there any way to set the maximum size of the spinner so after choosing an element, it shortens the choice with an ellipsis ("...") or something?

    Read the article

  • White dialog theme

    - by Al
    I've noticed some apps have a dialog with white background, including along the title border, as opposed to the default black. I know how to make the background white but the whiteness doesn't extend to the dialog's title border. This image: http://localhostr.com/files/25bb19/tether.png is an example of how I want the dialog to look. Anyone know I can do this? I mainly use AlertDialog.Builder to make my dialogs so ideally something I can easily to that.

    Read the article

  • problem with prototype.js Ajax functions

    - by Maksim Burnin
    my code(prototype 1.6.1) Event.observe(window, 'load', function() { new Ajax.Request('/modal/order_same/', { parameters: {}, onComplete: function(){alert('err0');}, onSuccess:function(){alert('err1');}, onCreate:function(){alert('err2');}, onFailure:function(){alert('err3');}, onException:function(){alert('err4');}, onLoaded:function(){alert('err5');} }); }); or Event.observe(window, 'load', function() { new Ajax.Updater(somelement,'/modal/order_same/', { parameters: {}, onComplete: function(){alert('err0');}, onSuccess:function(){alert('err1');}, onCreate:function(){alert('err2');}, onFailure:function(){alert('err3');}, onException:function(){alert('err4');}, onLoaded:function(){alert('err5');} }); }); all i get in ff3.7prea5 is "err2". my client says he has ff3.6.3 and same error firebug console says he's get the response and the status code is 200 works fine in opera, ie 6-8, ff on some computers any suggestions?

    Read the article

  • Supersized, show a div depending on the slide

    - by Dlacrem
    EDIT: So, I want to take a different approach to try and clarify what I'm looking for, I've been reading as much as I could these last hours and I feel I have a better grasp of how the system works, but I still don't know how to accomplish my goal. Reference links: -SUPERSIZED API So, I have the following script: <script type="text/javascript"> $(document.body).ready(function () { if (vars.current_slide == 5){**-I want it to display a div if the slider is the number 5-** } }); </script> My questions are these: 1) What do I add in the - - area to display a div that only shows up when the slider is at the 5th slide? 2) Am I doing the rest right or am I missing something? I created that code so it could be terribly wrong lol, hopefuly I got something right :P That's all, hope this clarifies it. Thank you all for the help! I'm really excited to start creating my own scripts :D Alright, so I've uploaded the site with the code you posted and it still doesn't seem to work, I also tried reducing the code to the conditional and the result only but that didn't work either, mind checking it out? Click Here Thanks for giving it a thought!

    Read the article

  • Challenges w.r.t. proximity between application hosted outside Amazon and Amazon persistence service

    - by Kabeer
    Hello. This is about hosting a web portal. Earlier my topology was entirely based on Amazon AWS but the price factor (especially for EC2) now makes me re-think. I'll now quickly come to what I have finally arrived at. I'll launch the portal that'll be hosted on Godaddy (unlimited plan on Windows). The portal uses SimpleDB for storing metadata and S3 for blobs. Locally available MySQL will be used for the ASP.Net provider services. Once the portal is profitable, I intent to move to Amazon in totality. Now considering the proximity between Godaddy & Amazon, would I face 'substantial' performance problems? Are there any suggestions to improve upon my topology.

    Read the article

  • how to control the width and height of default alert dialog in Android?

    - by sat
    AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Title"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show(); } }); AlertDialog alert = builder.create(); I am using above code to show alert dialog , By default it fills the screen in width and wrap_content in height. How to control the width and height of default alert dialog ? I tried , alert.getWindow().setLayout(100,100); // It dint work. How to get the layout params on the alert window and set manually the width and height ?

    Read the article

  • How to know when the user touches the OK button of the last StoreKit alert "Thank you. Your purchase

    - by Walchy
    I have integrated "In App Purchase" in a game to let the user unlock more levels. Everything works fine, but I have a little problem with the last alert "Thank You. Your purchase was successful. [OK]". My program gets informed that the transaction was successfully completed before this last alert pops up and so my game starts running again - then the alert comes up, annoying the user. I would like to wait with my game running until the user touches the "OK" button, but since it is an alert from StoreKit I have no idea when this happens or how I could catch it. I don't want to create another dialog (this time my own, therefor under my control) below the alert, just asking for touching "OK" again - would be a bad user experience. Anybody have any ideas?

    Read the article

  • Behavior of local variables in JavaScripts with()-statement

    - by thr
    I noticed some weird (and to my knowledge undefined behavior, by the ECMA 3.0 Spec at least), take the following snippet: var foo = { bar: "1", baz: "2" }; alert(bar); with(foo) { alert(bar); alert(bar); } alert(bar); It crashes in both Firefox and Chrome, because "bar" doesn't exist in the first alert(); statement, this is as expected. But if you add a declaration of bar inside the with()-statement, so it looks like this: var foo = { bar: "1", baz: "2" }; alert(bar); with(foo) { alert(bar); var bar = "g2"; alert(bar); } alert(bar); It will produce the following: undefined, 1, g2, undefined It seems as if you create a variable inside a with()-statement most browsers (tested on Chrome or Firefox) will make that variable exist outside that scope also, it's just set to undefined. Now from my perspective bar should only exist inside the with()-statement, and if you make the example even weirder: var foo = { bar: "1", baz: "2" }; var zoo; alert(bar); with(foo) { alert(bar); var bar = "g2"; zoo = function() { return bar; } alert(bar); } alert(bar); alert(zoo()); It will produce this: undefined, 1, g2, undefined, g2 So the bar inside the with()-statement does not exist outside of it, yet the runtime somehow "automagically" creates a variable named bar that is undefined in its top level scope (global or function) but this variable does not refer to the same one as inside the with()-statement, and that variable will only exist if a with()-statement has a variable named bar that is defined inside it. Very weird, and inconsistent. Anyone have an explanation for this behavior? There is nothing in the ECMA Spec about this.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >