Click here to Skip to main content
15,911,315 members
Home / Discussions / Android
   

Android

 
AnswerRe: android longitude and latitude Pin
thatraja4-Feb-14 3:01
professionalthatraja4-Feb-14 3:01 
QuestionApplication to start with Pin
agent_kruger31-Jan-14 4:08
professionalagent_kruger31-Jan-14 4:08 
AnswerRe: Application to start with Pin
Peter Leow31-Jan-14 4:41
professionalPeter Leow31-Jan-14 4:41 
AnswerRe: Application to start with Pin
thatraja4-Feb-14 3:02
professionalthatraja4-Feb-14 3:02 
QuestionHow to run App in background?? Pin
mAzeem2229-Jan-14 8:25
mAzeem2229-Jan-14 8:25 
AnswerRe: How to run App in background?? Pin
one_one13-Feb-14 20:57
one_one13-Feb-14 20:57 
Questiontime verifier Pin
Member 1055469027-Jan-14 23:09
Member 1055469027-Jan-14 23:09 
QuestionHow to use delay in for loop? Pin
chandan kumar24-Jan-14 0:08
chandan kumar24-Jan-14 0:08 
I am trying to display a multiplication table with delay. My code is working fine but I am not able to implement the delay.

Here is My code:-

Java
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class TestActivity  extends Activity{
Button tableButton1;
TextView txtView; 
Runnable r;
String s;
int value = 0; 
	static int count = 0;
	Handler handle = new Handler();
	StringBuilder sb = new StringBuilder();
	
	

        @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
                setContentView(R.layout.text_display);

              
        		txtView = (TextView) findViewById(R.id.outputTXT);
               tableButton1 = (Button) findViewById(R.id.seven);
               tableButton1.setOnClickListener(new OnClickListener() {
		    
			public void onClick(View v) {     
				Toast.makeText(getApplicationContext(), "display" , 222).show();
		    	
		    	
		    	value= Integer.parseInt(tableButton1.getText().toString()); 
		    	 r  = new Runnable() {
		    		
		    		@Override
		    		public void run() {
		    			// TODO Auto-generated method stub
		    			count+=1000;
		    			if(count==10000){
		    				
		    				count = 0;
		    				value=0;
		    				handle.removeCallbacks(r);
		    				sb.setLength(0);
		    				Toast.makeText(getApplicationContext(), "display counter"  +sb, 222).show();
		    			}else{
		    				
		    				sb.append(value + " x " + count/1000 + " = " + count/1000 * value+ "\n");
		    				Toast.makeText(getApplicationContext(), "Hi"  +sb, 222).show();
		    	                        handle.postDelayed(this, 1000);
		    			
		    			}
		    			
		    		}
		    	};
		             
		    }
       });
      }


Any answer is appreciable.

Thank in advance

modified 25-Jan-14 3:32am.

QuestionLooking for Cross platformers Pin
bryce23-Jan-14 16:46
bryce23-Jan-14 16:46 
AnswerRe: Looking for Cross platformers Pin
Ron Beyer23-Jan-14 17:34
professionalRon Beyer23-Jan-14 17:34 
QuestionAndroid project for blind Pin
Member 1051102021-Jan-14 6:20
Member 1051102021-Jan-14 6:20 
QuestionRe: Android project for blind Pin
thatraja21-Jan-14 16:14
professionalthatraja21-Jan-14 16:14 
AnswerRe: Android project for blind Pin
Member 1051102022-Jan-14 2:30
Member 1051102022-Jan-14 2:30 
GeneralRe: Android project for blind Pin
Shameel22-Jan-14 2:54
professionalShameel22-Jan-14 2:54 
GeneralRe: Android project for blind Pin
Richard MacCutchan22-Jan-14 2:57
mveRichard MacCutchan22-Jan-14 2:57 
GeneralRe: Android project for blind Pin
thatraja22-Jan-14 4:05
professionalthatraja22-Jan-14 4:05 
GeneralRe: Android project for blind Pin
Member 1051102022-Jan-14 4:09
Member 1051102022-Jan-14 4:09 
QuestionWrote my first android game... what are the best ways to promote it? Pin
KevenL20-Jan-14 6:20
professionalKevenL20-Jan-14 6:20 
AnswerRe: Wrote my first android game... what are the best ways to promote it? Pin
Clark Kent12328-Jan-14 5:51
professionalClark Kent12328-Jan-14 5:51 
QuestionEneter messaging framework for Android Pin
Lalit Nankani19-Jan-14 18:31
Lalit Nankani19-Jan-14 18:31 
QuestionAndroid with SQLite Database((Mono for Android, C#)) Pin
Member 1053221418-Jan-14 1:08
Member 1053221418-Jan-14 1:08 
AnswerRe: Android with SQLite Database((Mono for Android, C#)) Pin
thatraja19-Jan-14 22:04
professionalthatraja19-Jan-14 22:04 
Questionscenario to start Pin
SaturnPlanet17-Jan-14 12:55
SaturnPlanet17-Jan-14 12:55 
AnswerRe: scenario to start Pin
Peter Leow17-Jan-14 13:46
professionalPeter Leow17-Jan-14 13:46 
QuestionAndroid Eclipse SQLiteDatabase OnCreate is not called Pin
itforum Question16-Jan-14 23:12
itforum Question16-Jan-14 23:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.