Fatma AlKhaja

Fatma AlKhaja

  • NA
  • 3
  • 893

Putting a specific condition to start the activity of intent

Dec 3 2017 2:37 PM
Hi, I am having a bit of an issue with trying to write a java code for Android Studio,
So basically I want to put a certain condition so that once I click this button I want to check by whom was it clicked to start activity of intent to the page that is assigned for this user,
here is a sample code
Like if the doctor is reporting students then he'll be transferred to the report page
but if the student is reporting the doctor then he'll be transferred to another page for example his profile page.
I am using SQLITE database  
 
 
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String rID1 = rID.getText().toString();
String description1 = description.getText().toString();
v = new Violation();
v.setV_id(rID1);
v.setV_type(violation);
v.setV_campus(campus);
v.setV_description(description1);
v.setV_date(Date);

V_Violation.insertViolation(v);
addViolation(v);

Intent i$ = new Intent(ReportPage.this, RecordedVioaltions.class);
startActivity(i$);}
});