Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
package com.example.blueflametest1;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
((Button) findViewById(R.id.btnOK)).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String box1 = ((EditText)findViewById(R.id.edit1)).getText().toString();
String box2 = ((EditText)findViewById(R.id.edit2)).getText().toString();
String box3 = ((EditText)findViewById(R.id.edit3)).getText().toString();
String box4 = ((EditText)findViewById(R.id.edit4)).getText().toString();
String box5 = ((EditText)findViewById(R.id.edit5)).getText().toString();
String box6 = ((EditText)findViewById(R.id.edit6)).getText().toString();
String box7 = ((EditText)findViewById(R.id.edit7)).getText().toString();
String box8 = ((EditText)findViewById(R.id.edit8)).getText().toString();
String box9 = ((EditText)findViewById(R.id.edit9)).getText().toString();
String box10 = ((EditText)findViewById(R.id.edit10)).getText().toString();
String box11 = ((EditText)findViewById(R.id.edit11)).getText().toString();
String box12 = ((EditText)findViewById(R.id.edit12)).getText().toString();
String box13 = ((EditText)findViewById(R.id.edit13)).getText().toString();
Intent mail = new Intent(Intent.ACTION_SEND);
mail.setType("message/rfc822");
startActivity(Intent.createChooser(mail, "Send email via:"));
}
});
}
}
[\code]
String box1 = ((EditText)findViewById(R.id.edit1)).getText().toString();
public void onClick(View v) {
String firstName = ((EditText)findViewById(R.id.edit1)).getText().toString();
String lastName = ((EditText)findViewById(R.id.edit2)).getText().toString();
String emailAddress = ((EditText)findViewById(R.id.edit3)).getText().toString();
String problem = ((EditText)findViewById(R.id.edit4)).getText().toString();
String problemDetails = ((EditText)findViewById(R.id.edit5)).getText().toString();
String message = "From: " + firstName + " " + lastName + "\n";
message += "Email: " + emailAddress + "\n\n"; // double line space
message += "Problem: " + problem + "\n";
message += "Details:\n" + problemDetails;
Intent mail = new Intent(Intent.ACTION_SEND);
mail.setType("message/rfc822");
mail.putExtra(Intent.EXTRA_EMAIL, new String[] { "gizmorepairs@gizmorepairs.com" }); // sets who the email goes to
mail.putExtra(Intent.EXTRA_SUBJECT, "Android App Response");
mail.putExtra(Intent.EXTRA_TEXT, message);
startActivity(Intent.createChooser(mail, "Send email via:"));
}
Hi tony, you are now my android god so I hope you don't mind me messaging again
Would you know of anyway to bypass the email client and have the information sent directly from the app ?