Class integration in Manifest: application stopped

My manifest.xml raises error for ".RoleActivity". But If I replace my ".roleActivity" with others for checking, they all are okay. Here is my manifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.zobaed.androidlogin" >
 <uses-permission android:name="android.permission.INTERNET" />
 <application
    android:allowBackup="true"
  android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity android:name=".RoleActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

         <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
    <activity android:name=".DoctorLoginActivity">
        </activity>
    <activity android:name=".PatientLoginActivity">
        </activity>

   </application>
  </manifest>

Here is my RoleActivity. Tried to write switch case here. public class RoleActivity extends AppCompatActivity {

private Button btnPatient;
private Button btnDoctor;
private Button btnGuest;
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.log_in_role);


    btnPatient = (Button) findViewById(R.id.btpatient);
    btnDoctor = (Button) findViewById(R.id.btdoctor);
    btnGuest = (Button) findViewById(R.id.btguest);

    btnPatient.setOnClickListener((View.OnClickListener) this);
    btnDoctor.setOnClickListener((View.OnClickListener) this);
    btnGuest.setOnClickListener((View.OnClickListener) this);
}

public void onClick(View v) {
    switch (v.getId()) {
        case  R.id.btdoctor: {

            Intent i = new Intent(getApplicationContext(), DoctorLoginActivity.class);
            startActivity(i);
            break;
        }

        case R.id.btpatient: {

            Intent i = new Intent(getApplicationContext(), PatientLoginActivity.class);
            startActivity(i);
            break;
        }

    }
}

}

implement onClickListner in RoleActivity class and change code to

btnPatient.setOnClickListener( this);
btnDoctor.setOnClickListener(this);
btnGuest.setOnClickListener(this);

Your activity is not implementing View.OnClickListener. Unless you implement View.OnClickListener on your activity you cannot cast the activity as an OnClickListener. That is why you are getting error, probably a ClassCastException

 btnPatient.setOnClickListener((View.OnClickListener) this);
    btnDoctor.setOnClickListener((View.OnClickListener) this);
    btnGuest.setOnClickListener((View.OnClickListener) this);

implement View.OnClickListener on your activity. Change

public class RoleActivity extends AppCompatActivity

to

public class RoleActivity extends AppCompatActivity implements View.OnClickListener 

and then you can remove that casting

btnPatient.setOnClickListener(this);
btnDoctor.setOnClickListener(this);
btnGuest.setOnClickListener(this);

if you are not implemeting View.OnClickListener on your activity you can add the click listener as an anonymous inner class to handle clicks on views