0

This is my code:

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

/**
 * 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);
    }

    /**
     * This method is called when the order button is clicked.
     */
    public void submitOrder(View view) {
        display(1);
    }

    /**
     * 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);
    }

}

P.S I have tried clearing the cache.

Max Vollmer
  • 8,412
  • 9
  • 28
  • 43
  • Welcome to Stackoverflow! I have fixed the formatting of your code and edited the last statement of your question, to make it more precise. If you're unhappy with my edit, feel free to enhance your question again. Please provide any error message you get. Also, since you said you tried *"all the available solutions"*, it'd be good if you could actually list everything you tried. – Max Vollmer May 01 '18 at 15:24
  • Possible duplicate of [Cannot find R.layout.activity\_main](https://stackoverflow.com/questions/16045118/cannot-find-r-layout-activity-main) – Max Vollmer May 01 '18 at 15:27

0 Answers0