I have the following code.
public class Start extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
ArrayList<String> aPlayerList = getIntent().getStringArrayListExtra("playerList");
static ArrayList<Integer> aScores = getIntent().getIntegerArrayListExtra("scores");
...
I get an error when trying to make the ArrayList<Integer> aScores
static: Non-static method getIntent() cannot be referenced from a static context
, and I don't know how to fix this.
If it helps, this is how the intent was passed:
Bundle bund = new Bundle();
bund.putStringArrayList("playerList", playerList);
bund.putIntegerArrayList("scores", scores);
Intent intent = new Intent(Players.this, Start.class);
intent.putExtras(bund);
startActivity(intent);
Any help would be appreciated, and if you could add the code that would fix it that would be great. Thanks,