Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your heading and the information you provide does not really link but I will try my best to answer your question.</p> <p>In answering your title question you need to create a broadcast receiver to run when an SMS is received. A non-dynamic broadcast receiver is active even when the application is closed (but will be removed if the application is uninstalled). Thus set up the receiver to launch a activity as a popup can only be displayed if an activity is run; Unless you look at googles GCM which allows for notification type popups like toast messages and notification push's without an activity being launched. </p> <p>Your standard popup will require the receiver to launch the application first though. Here is a nice tutorial on sms broadcast receivers:</p> <p><a href="http://www.apriorit.com/our-company/dev-blog/227-handle-sms-on-android" rel="nofollow">http://www.apriorit.com/our-company/dev-blog/227-handle-sms-on-android</a></p> <p>Moreover if you want a notification style popup I suggest you get down and dirty with GCM else here is the code to do a normal popup once the receiver has launch the application.</p> <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(NuPos_testActivity.this); builder.setMessage(resp) .setNeutralButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } } ); AlertDialog alert = builder.create(); alert.show(); </code></pre> <p>Finally to answer you information provided you are not setting a variable and value for time.</p> <p>If you are trying to get the current time you can use:</p> <pre><code>Calendar c = Calendar.getInstance(); int seconds = c.get(Calendar.SECOND); </code></pre> <p>Hope some of this helps, its hard when you a re beginner, but stick through it and it becomes well worth the struggle.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload