0

So I really need your help guys! I recently started learning android and on my first app try the Android studio shows some error saying "Package R is not loaded" or "Package R not found" My code is 100% right and I even started entire project from scratch twice. Can you please help Me out?

  • 1
    Clean and rebuild did not help? – Vucko Aug 27 '16 at 15:34
  • Errors in R could be as simple as a String error or linking to an Id that doesn't exist. Can you show us the exact errors you're getting? – BR89 Aug 27 '16 at 15:37
  • import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @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);}} – Mayuresh Khare Aug 28 '16 at 06:04
  • so this is my code – Mayuresh Khare Aug 28 '16 at 06:04

1 Answers1

1

Clean your code with Ctrl + Alt + L

Blue
  • 22,608
  • 7
  • 62
  • 92
  • import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @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);} – Mayuresh Khare Aug 28 '16 at 06:04