本文整理汇总了Java中android.widget.Chronometer.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Chronometer.setText方法的具体用法?Java Chronometer.setText怎么用?Java Chronometer.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.Chronometer
的用法示例。
在下文中一共展示了Chronometer.setText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import android.widget.Chronometer; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
mConversationView = (ListView) view.findViewById(R.id.in);
mOutEditText = (EditText) view.findViewById(R.id.edit_text_out);
mStartDribblingButton = (Button) view.findViewById(R.id.btn_start_dribbling);
tv_shoot_count = (TextView) view.findViewById(R.id.tv_shoot_count);
mStartShootingButton = (Button) view.findViewById(R.id.btn_start_shooting);
mStartRawStream = (Button) view.findViewById(R.id.btn_start_raw_stream);
time = (Chronometer) view.findViewById(R.id.time);
et_ip = (EditText) view.findViewById(R.id.et_ip);
et_ip.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus){
GlobalVar.SERVER_ADDRESS = et_ip.getText().toString();
}
}
});
et_ip.setText(GlobalVar.SERVER_ADDRESS);
time.setText("00:00:00");
time.setFormat("计时:%s");
}
示例2: onPostCreate
import android.widget.Chronometer; //导入方法依赖的package包/类
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Trigger the initial hide() shortly after the activity has been
// created, to briefly hint to the user that UI controls
// are available.
// Set text of quick timer
Chronometer qt = (Chronometer) findViewById(R.id.quicktimer);
if (!mQuickTimerRunning) {
qt.setText("Quick Timer");
}
else {
String timeFields[] = mElapsedTime.split(":");
qt.setBase(SystemClock.elapsedRealtime()
- Integer.parseInt(timeFields[0])*60000 - Integer.parseInt(timeFields[1])*1000);
qt.start();
}
}
示例3: onCreate
import android.widget.Chronometer; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gatt_services_characteristics);
final Intent intent = getIntent();
mDeviceName = intent.getStringExtra(EXTRAS_DEVICE_NAME);
mDeviceAddress = intent.getStringExtra(EXTRAS_DEVICE_ADDRESS);
// Sets up UI references.
((TextView) findViewById(R.id.device_address)).setText(mDeviceAddress);
mGattServicesList = (ExpandableListView) findViewById(R.id.gatt_services_list);
mGattServicesList.setOnChildClickListener(servicesListClickListner);
mConnectionState = (TextView) findViewById(R.id.connection_state);
mDataField = (TextView) findViewById(R.id.data_value);
mStartDribblingButton = (Button) findViewById(R.id.btn_start_dribbling);
tv_shoot_count = (TextView) findViewById(R.id.tv_shoot_count);
mStartShootingButton = (Button) findViewById(R.id.btn_start_shooting);
mStartRawStream = (Button) findViewById(R.id.btn_start_raw_stream);
time = (Chronometer) findViewById(R.id.time);
et_ip = (EditText) findViewById(R.id.et_ip);
time.setText("00:00:00");
time.setFormat("计时:%s");
mStartDribblingButton.setOnClickListener(this);
mStartShootingButton.setOnClickListener(this);
mStartRawStream.setOnClickListener(this);
getActionBar().setTitle(mDeviceName);
getActionBar().setDisplayHomeAsUpEnabled(true);
Intent gattServiceIntent = new Intent(this, BluetoothLeService.class);
bindService(gattServiceIntent, mServiceConnection, BIND_AUTO_CREATE);
}
示例4: quickTimerOnClick
import android.widget.Chronometer; //导入方法依赖的package包/类
public void quickTimerOnClick(View v) {
Chronometer quicktimer = (Chronometer) findViewById(R.id.quicktimer);
if (!mQuickTimerRunning) {
quicktimer.setBase(SystemClock.elapsedRealtime());
quicktimer.start();
mQuickTimerRunning = true;
}
else {
quicktimer.stop();
updateModelAndFile();
mQuickTimerRunning = false;
quicktimer.setText("Quick Timer");
}
}
示例5: onCreate
import android.widget.Chronometer; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.progress);
mHandler = new Handler();
mStarting = false;
setBLE = false;
staticGraphic = false;
tempoStatico =0;
final Intent intent = getIntent();
mDeviceAddress = intent.getStringExtra(EXTRAS_DEVICE_ADDRESS);
mActivities = (Activities) intent.getSerializableExtra("a");
going = (ImageView)findViewById(R.id.going);
heartMax =(TextView)findViewById(R.id.heart_max);
heartMin =(TextView)findViewById(R.id.heart_min);
heartMed =(TextView)findViewById(R.id.heart_med);
//menu = (ImageButton)findViewById(R.id.bott_omino);
mGraphic = (Button) findViewById(R.id.graphic);
ok = (ImageButton)findViewById(R.id.m_lets_start);
stop = (ImageButton) findViewById(R.id.m_stop);
pause = (Button) findViewById(R.id.pause);
done = (ImageButton) findViewById(R.id.m_done_prog);
stop.setVisibility(View.INVISIBLE);
pause.setVisibility(View.INVISIBLE);
done.setVisibility(View.INVISIBLE);
heartRate = (Button)findViewById(R.id.heart_rate);
if(mDeviceAddress != null){
Intent gattServiceIntent = new Intent(this, BluetoothLeService.class);
bindService(gattServiceIntent, mServiceConnection, BIND_AUTO_CREATE);
}
milliseconds =0;
ch = (Chronometer) findViewById(R.id.chronometer);
timeFormat = new SimpleDateFormat("H:mm:ss");
timeFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
hmmss = timeFormat.format(milliseconds);
ch.setText(hmmss);
setOnClickButton();
setOnChronometer();
setImage();
// Start heartRate.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
startHeart();
}
}, START_HEART);
}