本文整理匯總了Java中android.widget.Button.isSelected方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.isSelected方法的具體用法?Java Button.isSelected怎麽用?Java Button.isSelected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.Button
的用法示例。
在下文中一共展示了Button.isSelected方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getClickedMeta
import android.widget.Button; //導入方法依賴的package包/類
private Meta getClickedMeta(Button clicked) {
short selected = -1;
short current = 0;
short length = 0;
for (int i = 0; i < mButtonItems.length; i++) {
final Button item = mButtonItems[i];
if (item == clicked) {
current = (short) i;
}
if (item.isSelected()) {
selected = (short) i;
}
if (!isButtonEmpty(item)) {
length += 1;
}
}
return new Meta(selected, current, length);
}
示例2: onCreate
import android.widget.Button; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 取得地圖物件
setContentView(R.layout.activity_maps);
mLayoutContainer = (ViewGroup) findViewById(R.id.layout_container);
mMapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
mMapFragment.getMapAsync(this);
// For tracking, Create an instance of GoogleAPIClient and LocationRequest.
configGoogleApiClient();
configLocationRequest();
// Buttons on map
mSwitchBtn = (Button) findViewById(R.id.btn_switch);
mTrackingBtn = (Button) findViewById(R.id.btn_tracking);
mPickTilesBtn = (Button) findViewById(R.id.btn_pick_tiles);
mGpxManagerBtn = (Button) findViewById(R.id.btn_gpx_files_list);
mPoiSearchBtn = (Button) findViewById(R.id.btn_search);
mBtnsSet.add(mPickTilesBtn);
mBtnsSet.add(mTrackingBtn);
mBtnsSet.add(mGpxManagerBtn);
mBtnsSet.add(mPoiSearchBtn);
mSwitchBtn.setOnClickListener(this);
for (View btn : mBtnsSet) {
btn.setOnClickListener(this);
}
// Add center cross into main map
mCrossSet.add(MAP_CODE_MAIN, (ImageView) findViewById(R.id.cross));
// 取得ActionBar
mActionBar = getSupportActionBar();
// 還原各項設定
SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);
// 檢查是否紀錄航跡中
mTrackingBtn.setSelected(prefs.getBoolean("isTracking", false));
if (mTrackingBtn.isSelected()) {
// bind TrackingService
Intent bindIntent = new Intent(this, TrackingService.class);
bindService(bindIntent, this, BIND_AUTO_CREATE);
}
// 取得上次相機位置
LatLng lastTarget = new LatLng(prefs.getFloat(
"cameraLat", (float) TAIWAN_CENTER.latitude),
prefs.getFloat("cameraLon", (float) TAIWAN_CENTER.longitude));
Float lastZoom = prefs.getFloat("cameraZoom", STARTING_ZOOM);
lastCameraPosition = new CameraPosition(lastTarget, lastZoom, 0, 0);
// 取得已開啟的GPX檔案
mGpxFileList = prefs.getStringSet("gpxFiles", mGpxFileList);
// 取得POI檔案
poiFile = prefs.getString("poiFile", null);
// 取得離線地圖檔案
mapFile = prefs.getString("mapFile", null);
themeFile = prefs.getString("themeFile", null);
// 還原座標表示設定
CoorSysList.coorSetting = prefs.getInt("coorSetting", COOR_WGS84_D);
}