how to make text view clickable in android?

前端 未结 11 1584
轮回少年
轮回少年 2020-12-01 18:04

is it possible in android to make text view clickable if yes then how ??and if not then what will be the way for make a label clickable??i want to implement a call activit

11条回答
  •  情话喂你
    2020-12-01 18:22

    Simply try this one:-

    Implement View.OnClickListener, then simply apply switch case and define the id of your text view in the case and pass the intent.

    example:-

         @Override
     public void onClick(View v) {
        //TODO Auto-generated method stub
    
       switch (v.getId()) {
    case R.id.textView:
        startActivity(new Intent(this,CalledClass.class));
    
        break;
    
    default:
        break;
    }
    

    //here textView is id for the textView I chose.

提交回复
热议问题