Aşagıda şu anki sistemin zamanını alıp ekranda gösteren ve geri sayım yapan kod vardır iyi çalışmalar dilerim faydalı olması dileğiyle

public class MainActivity extends Activity  {

private santimer timer;
private long startTime ;
private final long interval = 1000;
private Button start;
private TextView text;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text = (TextView) findViewById(R.id.timer);

Time time = new Time();
time.setToNow();

/* SimpleDateFormat sdf1 = new SimpleDateFormat(“d-M-yyyy hh:mm”);
sdf1.setTimeZone(TimeZone.getTimeZone(“Turkey”));
String timeTur = sdf1.format(new Date());
Date dateCur = null;
try {
dateCur = sdf1.parse(timeTur);
} catch (ParseException e) {
e.printStackTrace();
}
startTime = dateCur.getTime(); */

String endTime = “19:49” ;
SimpleDateFormat sdf = new SimpleDateFormat(“d-M-yyyy”);

String currentDateandTime = sdf.format(new Date());

SimpleDateFormat formatter = new SimpleDateFormat(“d-M-yyyy hh:mm”);

Date dateCurrent = null;

String toParse =  currentDateandTime + ” ” + endTime; // Results in “2-5-2012 20:43”

Date date = null; // You will need try/catch around this
try {
date = formatter.parse(toParse);

} catch (ParseException e) {
e.printStackTrace();
}
long endMillis = date.getTime();

long currentTime= System.currentTimeMillis();

startTime = endMillis – currentTime ;
startTime -= 120 * 60 * 1000 ;
if (startTime < 0 ) startTime += 24*60*60*1000;
timer = new santimer(startTime, interval);
timer.start();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}

return super.onOptionsItemSelected(item);
}

private class santimer extends CountDownTimer {

public santimer(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
// TODO Auto-generated constructor stub

}

@Override
public void onFinish() {
// TODO Auto-generated method stub

text.setText(“Time’s up!” + startTime);

}

@Override
public void onTick(long millisUntilFinished) {
// TODO Auto-generated method stub

Date date = new Date(millisUntilFinished);
SimpleDateFormat formatter = new SimpleDateFormat(“HH:mm:ss”);
String formatted = formatter.format(date);
text.setText(“Time remain:” + formatted);

}

}
}

iyi çalışmalar dilerim
Ramazan CESUR…