本文整理汇总了Java中android.view.View.getId方法的典型用法代码示例。如果您正苦于以下问题:Java View.getId方法的具体用法?Java View.getId怎么用?Java View.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
import android.view.View; //导入方法依赖的package包/类
@OnClick({R.id.btnEmail, R.id.btnFacebook, R.id.btnTwitter, R.id.btnGoogle})
void onClick(View view) {
switch (view.getId()) {
case R.id.btnEmail: {
router.toEmailLogin();
break;
}
case R.id.btnFacebook: {
// TODO fb login
break;
}
case R.id.btnGoogle: {
final Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(apiClient);
startActivityForResult(signInIntent, RC_GOOGLE_SIGNIN);
break;
}
case R.id.btnTwitter: {
// TODO twitter login
break;
}
default: {
break;
}
}
}
示例2: onRestoreInstanceState
import android.view.View; //导入方法依赖的package包/类
@Override
protected void onRestoreInstanceState(Parcelable state) {
if (!(state instanceof SavedState)) {
super.onRestoreInstanceState(state);
return;
}
final SavedState ss = (SavedState) state;
super.onRestoreInstanceState(ss.getSuperState());
final SparseArray<Parcelable> behaviorStates = ss.behaviorStates;
for (int i = 0, count = getChildCount(); i < count; i++) {
final View child = getChildAt(i);
final int childId = child.getId();
final LayoutParams lp = getResolvedLayoutParams(child);
final Behavior b = lp.getBehavior();
if (childId != NO_ID && b != null) {
Parcelable savedState = behaviorStates.get(childId);
if (savedState != null) {
b.onRestoreInstanceState(this, child, savedState);
}
}
}
}
示例3: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.buttonTransfer:
if (isValidTransferCash())
new AccountService(this).isExist(editTextToWallet.getText().toString(), REQUEST_IS_EXIST);
break;
case R.id.buttonScanQR:
openQRScanner();
break;
case R.id.buttonClear:
clearInputWallet(view);
break;
default:
break;
}
}
示例4: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.sign_in_button:
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, 1);
break;
case R.id.sign_out_button:
Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
Log.w("credentials","Status: "+ status.getStatus());
Log.w("credentials","StatusMessage: "+ status.getStatusMessage());
}
});
break;
}
}
示例5: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
// dialogOnclickInterface = (IDialogOnclickInterface) context;
switch (v.getId()) {
// case R.id.confirm:
//// dialogOnclickInterface.confirmOnclick();
//// turnGPSOn(getContext());
// Intent intent = new Intent(
// Settings.ACTION_LOCATION_SOURCE_SETTINGS);
// context.startActivity(intent);
// cancel();
// break;
default:
break;
}
}
示例6: onClick
import android.view.View; //导入方法依赖的package包/类
@OnClick({R.id.btn_sign_up, R.id.btn_cancel})
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_sign_up:
switch (mType) {
case 1:
InvitationActivity.show(mContext, mInvitationImg);
break;
case 2:
mPresenter.signUp(mDetail.getId());
break;
}
break;
case R.id.btn_cancel:
DialogHelper.getConfirmDialog(mContext, "", "是否确认取消?", "是", "否", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mPresenter.cancelApply(mDetail.getId());
}
}).show();
break;
}
}
示例7: save
import android.view.View; //导入方法依赖的package包/类
public void save(View view) {
vibrator.vibrate(60);
switch (view.getId()) {
case R.id.jpg:
Viewshot.of(frameLayout.getRootView()).setOnSaveResultListener(this).toJPG().save();
break;
case R.id.png:
Viewshot.of(frameLayout).setOnSaveResultListener(this).toPNG().save();
break;
case R.id.nomedia:
Viewshot.of(frameLayout).setOnSaveResultListener(this).toNomedia().save();
break;
}
}
示例8: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
if (v.getId() == R.id.fullscreen && currentState == CURRENT_STATE_NORMAL) {
Toast.makeText(getContext(), "Play video first", Toast.LENGTH_SHORT).show();
return;
}
super.onClick(v);
}
示例9: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
if (v.getId() == R.id.delete) {
int position = -1;
AttackData attackData = (AttackData) v.getTag();
position = mAttacks.indexOf(attackData);
if (position != -1) {
mOnItemDeleteClickListener.onItemDeleteClick(attackData, position);
}
} else {
mOnItemClickListener.onItemClick((AttackData) v.getTag());
}
}
示例10: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View view) {
if (ivLoading.isShown()) return;
if (view.getId() == R.id.ivCancel) {
back();
} else if (view.getId() == R.id.ivCheck) {
saveImage();
}
}
示例11: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v)
{
switch (v.getId()) {
case R.id.sync_now_button:
LDLN.initiateSync(mActivity, mActivity);
break;
}
}
示例12: onWidgetClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onWidgetClick(View view) {
switch (view.getId()) {
case R.id.btn_set_transparent:
sbChangeAlpha.setProgress(0);
break;
}
}
示例13: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.v1:
openKeyboard(v, resetLicense(0));
break;
case R.id.v2:
openKeyboard(v, resetLicense(1));
break;
case R.id.v3:
openKeyboard(v, resetLicense(2));
break;
case R.id.v4:
openKeyboard(v, resetLicense(3));
break;
case R.id.v5:
openKeyboard(v, resetLicense(4));
break;
case R.id.v6:
openKeyboard(v, resetLicense(5));
break;
case R.id.v7:
openKeyboard(v, resetLicense(6));
break;
case R.id.v8:
toggleElectricalTag();
openKeyboard(v, resetLicense(7));
break;
}
}
示例14: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
if (onFlowBarActionListener == null) {
return;
}
switch (v.getId()) {
case R.id.addFriendBt:
onFlowBarActionListener.onAddFriend();
break;
case R.id.cancelBt:
onFlowBarActionListener.onCancel();
break;
}
}
示例15: onClick
import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.tv_start:
Intent intent = new Intent(mActivity, VersionUpdateService.class);
intent.putExtra(VersionUpdateService.UPDATE_URL, mVersionResult.getUrl());
mActivity.startService(intent);
break;
case R.id.tv_cancel:
break;
}
dismiss();
}