Example usage for android.view View getId

List of usage examples for android.view View getId

Introduction

In this page you can find the example usage for android.view View getId.

Prototype

@IdRes
@ViewDebug.CapturedViewProperty
public int getId() 

Source Link

Document

Returns this view's identifier.

Usage

From source file:com.chess.genesis.activity.GameListLocalFrag.java

@Override
public void onClick(final View v) {
    if (v.getId() == R.id.topbar_plus)
        new NewLocalGameDialog(v.getContext(), handle).show();
    else if (v.getId() == R.id.menu)
        openMenu(v);/*from   ww w . ja v a  2s  .c o m*/
}

From source file:de.vanita5.twittnuker.activity.support.AccountSelectorActivity.java

@Override
public void onClick(final View view) {
    switch (view.getId()) {
    case R.id.save: {
        final long[] checkedIds = mListView.getCheckedItemIds();
        if (checkedIds.length == 0 && !isSelectNoneAllowed()) {
            Toast.makeText(this, R.string.no_account_selected, Toast.LENGTH_SHORT).show();
            return;
        }// www  .  j  a  v  a 2s .  c  om
        final Intent data = new Intent();
        data.putExtra(EXTRA_IDS, checkedIds);
        setResult(RESULT_OK, data);
        finish();
        break;
    }
    }
}

From source file:com.acceleratedio.pac_n_zoom.FindTagsActivity.java

public void onClick(View vw) {

    if (vw.getId() == R.id.ed_tgs)
        dsply_tags();/*from  ww w  .  ja  v a 2 s.c  o  m*/
    else {

        Button btn_vw = (Button) vw;
        CharSequence btn_sqn = btn_vw.getText();
        final StringBuilder strBldr = new StringBuilder(btn_sqn.length());
        strBldr.append(btn_sqn);
        req_str += strBldr.toString();

        Intent intent = new Intent(FindTagsActivity.this, PickAnmActivity.class);
        intent.putExtra("requestString", req_str);
        startActivity(intent);
    }
}

From source file:com.gigathinking.simpleapplock.Upgrade.java

@Override
public void onClick(View v) {
    if (v.getId() == R.id.id_btn_upgrade) {
        int purchaseItem = ((RadioGroup) findViewById(R.id.id_rg_upgrade)).getCheckedRadioButtonId();
        String sku = "";
        if (purchaseItem == R.id.id_rb_no_ads) {
            sku = "no_ads";
        }/*from   w  ww.  j av  a2s.com*/
        if (purchaseItem == R.id.id_rb_adv_prot) {
            sku = "adv_prot";
        }
        new DoPurchase().execute(sku);
    }
}

From source file:com.example.tensioncamapp.activity.ViewPicActivity.java

/** Added switch-clauses to enable functionality for two buttons */
@Override//from w  w  w. j a va2 s  . co m
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.discard_button:
        this.discard.setEnabled(false);
        Intent openCamActivity = new Intent(ViewPicActivity.this, CameraActivity.class);
        startActivity(openCamActivity);
        break;
    case R.id.analyze_button:
        this.analyze.setEnabled(false);

        this.progressBar.setVisibility(0);
        String path = FileHandler.pathToString();
        try {
            new SendTask().execute(path);
        } catch (Exception e) {
            e.printStackTrace();
        }
        break;
    }
}

From source file:com.app.jdy.ui.FaceValueActivity.java

@Override
public void onClick(View v) {
    switch (v.getId()) {
    case R.id.back_img:
        finish();/* ww  w.j av a2  s . co m*/
        break;

    default:
        break;
    }
}

From source file:weavebytes.com.futureerp.activities.LoginActivity.java

@Override
public void onClick(View v) {
    switch (v.getId()) {

    case R.id.btnlogin:
        username = name.getText().toString();
        password = pass.getText().toString();
        if (TextUtils.isEmpty(username)) {
            name.setError("Enter Name");
        } else if (TextUtils.isEmpty(password)) {
            pass.setError("Enter Password");
        } else {/*from  w ww  .  j  av  a 2s  .  c o  m*/
            SendJsonRequest();
        }
        break;
    case R.id.btnregister:
        Intent it = new Intent(LoginActivity.this, RegistrationActivity.class);
        startActivity(it);
        break;

    }
}

From source file:edu.cwru.apo.Login.java

public void onClick(View v) {
    switch (v.getId()) {
    case R.id.login:
        API api = new API(this);
        if (!api.callMethod(Methods.login, this, username.getText().toString(),
                password.getText().toString())) {
            Toast msg = Toast.makeText(this, "Error: You must enter both a username and password to login",
                    Toast.LENGTH_SHORT);
            msg.show();/*from  w  w w . ja  v  a 2 s  .  co m*/
        }
        //api.callMethod(Methods.checkAES,this, (String[])null);
        break;

    case R.id.forgot_password:
        //start forgot password activity
        Intent forgotPasswordIntent = new Intent(Login.this, ForgotPassword.class);
        Login.this.startActivity(forgotPasswordIntent);
        break;
    default:
        //something went wrong add a throw here
    }
}

From source file:com.insthub.O2OMobile.Activity.C3_EditNameActivity.java

@Override
public void onClick(View v) {
    String nickname = mNickname.getText().toString().trim();
    switch (v.getId()) {
    case R.id.top_view_back:
        finish();//w w  w.  j a  v  a 2s .  c om
        break;
    case R.id.btn_save:
        if ("".equals(nickname)) {
            ToastView toast = new ToastView(C3_EditNameActivity.this,
                    getString(R.string.please_input_nickname));
            toast.setGravity(Gravity.CENTER, 0, 0);
            toast.show();
            mNickname.setText("");
            mNickname.requestFocus();
            break;
        } else if (nickname.length() < 1 || nickname.length() > 16) {
            ToastView toast = new ToastView(C3_EditNameActivity.this,
                    getString(R.string.nickname_wrong_format_hint));
            toast.setGravity(Gravity.CENTER, 0, 0);
            toast.show();
            mNickname.requestFocus();
        } else {
            mUserModel.changeNickname(nickname);
        }
    }
}

From source file:at.alladin.rmbt.android.sync.RMBTSyncRequestCodeFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo contextMenuInfo) {
    if (view instanceof TextView && view == codeText)
        menu.add(Menu.NONE, view.getId(), Menu.NONE, R.string.sync_request_code_context_copy);
    else/*from  w  ww.  java 2 s. com*/
        super.onCreateContextMenu(menu, view, contextMenuInfo);
}