Intent for opening gmail app in android unfortunately stops
<p>The app has an order button when it's clicked the gmail app should be opened with subject and body filed desirably but the intent for it in my code is not working and the app shows a message that it is unfortunately stopping. I've tried many ways to implement this but i'm unable to do so. </p>

<pre><code>package com.example.android.justjava;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import java.text.NumberFormat;

import static android.R.attr.value;
import static android.R.id.checkbox;
import static android.R.id.message;

/**
 * This app displays an order form to order coffee.
 */
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    int topping_price = 0;
    /**
     * This method is called when the order button is clicked.
     */
    public void submitOrder(View view) {
        String variable1,variable2,variable3;
        CheckBox cream = (CheckBox) findViewById(R.id.checkbox);
        CheckBox choco = (CheckBox) findViewById(R.id.checkbox_choco);
        boolean value1 = cream.isChecked();
        boolean value2 = choco.isChecked();

        if(value1 == true) {
            variable1 = "Yes";
            topping_price += 1;
        }
        else
            variable1 = "No" ;

        if(value2 == true) {
            variable2 = "Yes";
            topping_price += 2;
        }

        else
            variable2 = "No" ;

        EditText input_name = (EditText) findViewById(R.id.name);
        variable3 = input_name.getText().toString();

        if((quantity + count) == 0){
            topping_price = 0;
            variable1 = "No";
            variable2 = "No";
        }

        String price_message = "Whipped cream topping: " + variable1 + "\nChocolate topping: " + variable2 +"\nName: " + variable3 +"\nQuantity: " + (quantity + count) +"\nTotal $" + (( quantity + count ) * 10 + topping_price ) + "\nThank You";
        displayMessage(price_message);
        topping_price = 0 ;

        Intent sendIntent = new Intent(Intent.ACTION_SENDTO);
        sendIntent.setType("*/*");
        sendIntent.setData(Uri.parse("masquerade0097@gmail.com"));
        sendIntent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");
        sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "masquerade0097@gmail.com" });
        sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Just Java order for " + variable3);
        sendIntent.putExtra(Intent.EXTRA_TEXT,"Whipped cream topping: " + variable1 + "\nChocolate topping: " + variable2 +"\nName: " + variable3 +"\nQuantity: " + (quantity + count) +"\nTotal $" + (( quantity + count ) * 10 + topping_price ) + "\nThank You");
//        startActivity(sendIntent);
        if (sendIntent.resolveActivity(getPackageManager()) != null) {
            startActivity(sendIntent);
        }    
    }

    /**
     * This method displays the given text on the screen.
     */
    private void displayMessage(String message) {
        TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
        priceTextView.setText(message);
    }

    int quantity = 1;
    int count = 0;

    public void increment(View view){
        if((quantity + count) &lt; 101)
            count = count + 1;
        display(quantity + count );
        displayPrice( (quantity + count) * 10);
    }

    public void decrement(View view){

        if((quantity + count) != 0)
            count = count - 1;

        display(quantity + count);
        displayPrice((quantity + count) * 10);

    }
    /**
     * This method displays the given quantity value on the screen.
     */
    private void display(int number) {
        TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
        quantityTextView.setText("" + number);
    }

    private void displayPrice(int number){
        TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
        priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
    }
}
</code></pre>