Despite my numerous attempts to modify the specific line in question, including leaving it empty, turning it into a comment, or removing it entirely, the error message persists. I even went as far as deleting the class and creating a new one, but the same line continues to be flagged as the issue.
The problematic code line (109) is highlighted below:
package com.example.president;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
public class Game extends AppCompatActivity implements View.OnClickListener {
private Manager gManager;
Player p1,p2,p3;
private ImageView[] hand;
private ImageView[] curr;
private ImageView[] next= new ImageView[3];
private int[] turn = {0, 1, 2};
private int cthrow;
public int[] cards =
{
R.drawable.c3,
R.drawable.c4,
R.drawable.c5,
// Remaining card images truncated for brevity...
R.drawable.d11,
R.drawable.d12,
R.drawable.d13,
R.drawable.d1,
R.drawable.d2,
R.drawable.j1,
R.drawable.j2
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game);
p1 = new Player("p1");
p2 = new Player("p2");
p3 = new Player("p3");
this.hand = new ImageView[18];
String str;
int resId;
int i;
for (i=0;i<hand.length;i++)
{
str = "card"+i;
resId = getResources().getIdentifier(str, "id", getPackageName());
hand[i]= (ImageView)findViewById(resId);
hand[i].setOnClickListener(this);
}
for (i=0; i<4; i++)
{
str="board"+i;
resId = getResources().getIdentifier(str, "id", getPackageName());
curr[i]= (ImageView)findViewById(resId);
curr[i].setOnClickListener(this);
}
this.gManager = new Manager(this, p1, p2, p3);
this.gManager.handingDeck(p1, p2, p3);
[[[LINE 109]]]
startGame(p1, p2, p3);
}
public void startGame(Player p1, Player p2, Player p3) {
Player p=p1;
int i;
for (i=0; i < 18; i++) {
hand[i].setImageResource(cards[p.getHand().get(i).getIndex()]);
}
String text = p1.getHand().toString();
TextView change = (TextView)findViewById(R.id.textView);
change.setText(text);
}
@Override
public void onClick(View v) {
int i, cnum=0, t=0, resId;
boolean found = false;
Player p=p1;
cthrow=1;
for (i = 0; i < 18 && (!(found)); i++)
{
if (v.getId() == hand[i].getId())
{
String str="card"+cnum;
resId=getResources().getIdentifier(str, "id", getPackageName());
next[turn[t]]= (ImageView)findViewById(resId);
found=true;
curr[cthrow].setImageResource(cards[p.getHand().get(i).getIndex()]);
p.getHand().remove(i);
next[turn[t]].setVisibility(View.INVISIBLE);
if(cnum<10)
cnum=18-cnum;
else
cnum=18-cnum+1;
cthrow++;
}
}
}
}
Even with an empty line at that position, the error persists.