Java 单击卡时,卡视图操作没有响应

Java 单击卡时,卡视图操作没有响应,java,android,android-layout,android-cardview,Java,Android,Android Layout,Android Cardview,我设计了一个android界面,允许用户从显示的菜单项列表中选择操作。 但是,即使在LoadDashboard.Java 这是我的xml文件名fragment_dashboard.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

我设计了一个android界面,允许用户从显示的菜单项列表中选择操作。 但是,即使在
LoadDashboard.Java

这是我的xml文件名fragment_dashboard.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/cm_background_color"
    android:gravity="center_horizontal"
    android:orientation="horizontal"
    tools:context=".LoadDashboard">


    <LinearLayout
        android:id="@+id/layout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="false"
        android:layout_marginTop="0dp"
        android:background="@color/textColorWhite"
        android:orientation="vertical">

        <TableLayout
            android:id="@+id/dashboardTable"
            android:layout_width="match_parent"
            android:layout_marginTop="50dp"
            android:layout_height="match_parent">

            <TableRow
            android:id="@+id/firstRow"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

                <androidx.cardview.widget.CardView
                    android:id="@+id/searchPatientCard"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_margin="8dp"
                    android:clickable="true"
                    android:layout_weight="1">

                    <RelativeLayout
                        android:id="@+id/findPatientView1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:clickable="true"
                        android:focusable="true">

                        <ImageView
                            android:id="@+id/findpatienticon"
                            android:layout_width="80dp"
                            android:layout_height="80dp"
                            android:layout_alignParentTop="true"
                            android:layout_centerInParent="true"
                            android:contentDescription="@string/logo_desripion"
                            android:src="@drawable/find_patient_search" />

                        <TextView
                            android:id="@+id/findPatient"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/findpatienticon"
                            android:layout_centerHorizontal="true"
                            android:layout_gravity="center"
                            android:layout_marginTop="10dp"
                            android:layout_marginBottom="15dp"
                            android:text="Find Patient"
                            android:textSize="18sp" />

                    </RelativeLayout>

                </androidx.cardview.widget.CardView>
                 <!-- first element of the row-->
            </TableRow>
        </TableLayout>

    </LinearLayout>

</RelativeLayout>
package org.ugandaemr.mobile;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;


public class LoadDashboard extends AppCompatActivity {
    public Context _context;
    public CardView searchPatient,fetch_patient,work_summary,settings,aboutus,frequently_asked_questions;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_dashboard);
        searchPatient=findViewById(R.id.searchPatientCard);
        searchPatient.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(LoadDashboard.this,org.ugandaemr.mobile.FindPatient.class);
                Log.e("Break Point", String.valueOf(R.id.searchPatientCard));
                startActivity(intent);
            }
        });


}}