Results 1 to 6 of 6
  1. #1
    nour is offline Member
    Join Date
    Oct 2011
    Posts
    12
    Rep Power
    0

    Default toast wont work in time

    hi there
    iam trying to make a toast in specific time , but when i start the emulator and wait for the minute to change it dosent do anything ,
    but reloading the application shows the toast massage (just in that minute).
    here is the code:

    Java Code:
    public class Awkat_sala_lodActivity extends Activity {
        
        MediaPlayer myAudio;
    	/** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            Calendar ci = Calendar.getInstance();
    
            String CiDateTime =   
                 (ci.get(Calendar.MONTH) + 1) + "/" +
                 ci.get(Calendar.DAY_OF_MONTH) + "   " +
                 ci.get(Calendar.HOUR_OF_DAY) + ":" +
                 ci.get(Calendar.MINUTE);
       	 myAudio = MediaPlayer.create(this, R.raw.ce);
     /////
    		if(ci.get(Calendar.MONTH) + 1 == 4)	{
    			if(ci.get(Calendar.DAY_OF_MONTH) == 10){
    				if(ci.get(Calendar.HOUR_OF_DAY) == 20 ){
    					if(ci.get(Calendar.MINUTE) ==05){
    						 Toast.makeText(Awkat_sala_lodActivity.this, "test", Toast.LENGTH_LONG).show();
    				        myAudio.start();
    				   	 
    								}
    				}
    why that happens and how i can fix this so it work on time without refreshing it to get the result .
    thanks for the helpers and have a nice day.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: toast wont work in time

    Quote Originally Posted by nour View Post
    hi there
    iam trying to make a toast in specific time , but when i start the emulator
    What emulator?

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  3. #3
    nour is offline Member
    Join Date
    Oct 2011
    Posts
    12
    Rep Power
    0

    Default Re: toast wont work in time

    hi

    iam not using db
    emulator = virtual mobile device that runs on your computer

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: toast wont work in time

    CLDC/MIDP or Android?

    iam not using db
    That's my initials, silly.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  5. #5
    nour is offline Member
    Join Date
    Oct 2011
    Posts
    12
    Rep Power
    0

    Default Re: toast wont work in time

    Android

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    10,094
    Rep Power
    17

    Default Re: toast wont work in time

    Moved from New to Java. In future, please post in an appropriate section.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. Why wont it work???
    By fredrik8719 in forum New To Java
    Replies: 0
    Last Post: 04-08-2012, 07:38 PM
  2. Why Wont This Work???
    By Billywizz in forum New To Java
    Replies: 11
    Last Post: 03-09-2011, 02:33 AM
  3. why wont the %.2f work here?
    By jjth39347 in forum New To Java
    Replies: 2
    Last Post: 03-06-2011, 05:55 AM
  4. class that wont work out properly.
    By vampire-elf in forum New To Java
    Replies: 7
    Last Post: 09-07-2010, 01:39 AM
  5. save will work but load wont?!?!
    By Sticks_ll in forum New To Java
    Replies: 1
    Last Post: 06-12-2008, 04:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •