Commit 694311f8 authored by james.clarke2's avatar james.clarke2

Add new file

parent e093a922
package com.example.carrentals;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class Feedback extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_feedback);
final EditText edit1 = (EditText)findViewById(R.id.edit1);
final EditText edit2 = (EditText)findViewById(R.id.edit2);
Button btn = (Button) findViewById(R.id.ButtonFeedback);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/html");
i.putExtra(Intent.EXTRA_EMAIL, new String("xyjz@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "Feedback");
i.putExtra(Intent.EXTRA_TEXT, "Name;" +edit1.getText() + "\n Message:" + edit2.getText());
try {
startActivity(Intent.createChooser(i, "Please select Email"));
}
catch (android.content.ActivityNotFoundException ex)
{
Toast.makeText(Feedback.this, "There is no Email", Toast.LENGTH_SHORT).show();
}
}
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment