Próbuję wykonać ten samouczek z google, aby utworzyć własną aplikację na Androida w Android Studio. Ale kiedy śledzę 4th krok na tej stronie: http://developer.android.com/training/basics/firstapp/starting-activity.html Android Studio kończy się ten błąd:Android Studio ERROR: Nie można rozpoznać symbolu "Wyświetl"
Cannot resolve symbol 'View'
To właśnie mój kod wygląda w tej chwili:
public class MainActivity extends ActionBarActivity {
/** Called when the user clicks the Send button */
public void sendMessage(View view) { <--- (This line ends up with the error)
// Do something in response to button
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Co złego w tym kodzie ? Nie mam doświadczenia w Javie i po przejrzeniu innych pytań wciąż nie mogłem znaleźć odpowiedniego rozwiązania.
Dzięki za pomoc!
Proszę pokazać swoje importu – 2Dee
Oczyść swój projekt i sprawdzić, czy to działa. –
@ 2dee Jak wyświetlić mój import? (Nowy program/java) – Stefan