Main Activity
package com.example.android.justjava; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void submitOrder(View view){ display(1); } private void display(int number){ TextView quantityTextView = (TextView) findViewById( R.id.quantity_text_view); quantityTextView.setText("" + number); } @Override public boolean onCreateOptionsMenu(Menu menu){ // Inflate the menu; this adds items to the action getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item){ int id = item.getItemId(); if ( id == R.id.action_settings){ } } }
getting paste error
1. read the error message
2. compare to working code
3. undo
4. ask for help
git hub gist
private void displayPrice(int number){ TextView priceTextView = (TextView) findViewById(R.id.price_text_view); priceTextView.setText(NumberFormat.getCurrencyInstance().format(number)); }