Posts

Showing posts from December 3, 2018

Android: How to use a card view instead of a button

Image
up vote 0 down vote favorite I have a dialog which currently opens on a button click and works fine but it means I have an ugly button that does not look good, I would prefer it to be opened from a CardView . This is the card view: CardView manager=findViewById(R.id.manager_card); manager.setOnClickListener(new View.OnClickListener() @Override public void onClick(View view) ); And this is the dialog which currently opens from a button click: Button btnLoginDialog; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_in); // Init Widget Button and set click listener btnLoginDialog = (Button) findViewById(R.id.btnLoginDialog); btnLoginDialog.setOnClickListener(this); @Override public void onClick(View v) if (v == btnLoginDialog) // Create Object of Dialog class final Dialog login = new Dialog(this); // Set GUI of login screen login.setCo