I am trying to develop an application that allow user to make phone call when the contact has been selected from recyclerview, sometimes one contact could have more than 1 phone number.
Here is the recyclerAdapter
I will thankfull for your help
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
int viewType = getItemViewType(position);
switch (viewType){
case TYPE:
default:
ItemViewHolder itemViewHolder = (ItemViewHolder) holder;
Contacts contacts = (com.example.myappl.Contacts) listRecycleItem.get(position);
itemViewHolder.tvCie.setText(contacts.getCompany());
itemViewHolder.tvTel1.setText(contacts.getPhone1());
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_CALL);
//
context.startActivity(intent);
}
});
}
New contributor
meyes84 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.