The method onCreate(bundle) is undefined for the object type-Collection of common programming errors
@StinePike’s answers fixes your immediate problem. But you also need to read about Intents. These are basically just a way to send messages. It is an implicit action in that it doesn’t start something but tells something what to do and how to handle certain data. I say this because I believe you are misled in that you have a function called getIntent(). This doesn’t need to be a function in your class but this is how you receive data if this Activity is started with an Intent.
Say you start an Activity like:
Intent intent = new Intent(MyActivity.this, NextActivity.class); // MyActivity is the Activity you are currently in and NextActivity is the Activity you are starting
intent.putExtra("people", "Fred"); // This isn't necessary but a way to pass data. I put "Fred" but this could be a String variable or something else
startActivity(intent);
In NextActivity you might do:
@Override
public void onCreate(Bundle bundle)
{
Intent recIntent = getIntent(); // this gets the intent information sent from MyActivity
String data = recIntent.getStringExtra("people"); // data now equals the String Fred
}
no need for you to create a function called getIntent(), it is a native function. So when you use getIntent() it is a good idea to check for null in case this Activity wasn’t started with an Intent. Maybe it was the launcher Activity