本文整理汇总了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);
}