Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple errors asking me to rename
    text
    copied!<p>MainActivity.java - file</p> <p>There's an error at "<code>protected void onCreate(Bundle savedInstanceState)</code> - asking me to rename <code>onCreate</code> method error on the line below that - There are no suggestions available</p> <p>Another error at </p> <pre><code>EditText editText = (EditText) findViewByID(R.ID.edit_message); - edit_message cannot be resolved </code></pre> <p>Again, an error here <code>getMenuInflater().inflate(R.menu.main, menu);</code> - asking me to rename "main"</p> <pre><code>public class MainActivity extends Activity { public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_item); getActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void sendMessage (View view) { Intent intent = new Intent(this, DisplayMessageActivity.class); EditText editText = (EditText) findViewById(R.id.edit_message); String message = editText.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); } } </code></pre> <p>My displayMessage - java file</p> <p>error at <code>setContentView(R.layout.activity_display_message);</code> - <code>active_display_message</code> cannot be resolved.</p> <pre><code>public class DisplayMessageActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_display_message); // Show the Up button in the action bar. setupActionBar(); Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); TextView textView = new TextView(this); textView.setTextSize(40); textView.setText(message); setContentView(textView); } /** * Set up the {@link android.app.ActionBar}, if the API is available. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void setupActionBar() { if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB) { getActionBar().setDisplayHomeAsUpEnabled(true); } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // This ID represents the Home or Up button. In the case of this // activity, the Up button is shown. Use NavUtils to allow users // to navigate up one level in the application structure. For // more details, see the Navigation pattern on Android Design: // // http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload