當前位置: 首頁>>代碼示例>>Java>>正文


Java Chronometer.setText方法代碼示例

本文整理匯總了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");
}
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:22,代碼來源:BluetoothChatFragment.java

示例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();
       }
}
 
開發者ID:sw-devendra,項目名稱:SpeechTimer,代碼行數:20,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:36,代碼來源:DeviceControlActivity.java

示例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");
	}
}
 
開發者ID:sw-devendra,項目名稱:SpeechTimer,代碼行數:15,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:ComputerEngineering,項目名稱:iWish,代碼行數:49,代碼來源:ProgressActivity.java


注:本文中的android.widget.Chronometer.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。