package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ListView; public class PlayerActivity2 extends AppCompatActivity { ListView simpleList; String SerialNo[] = {"1", "2", "3", "4", "5", "6","7","8","9","10"}; int flags[] = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8, R.drawable.image9, R.drawable.image10}; String Names[] = {"mmm", "nnn", "aaa.", "bbb", "ccc", "ddd","eee jk"," ijk","Virgil jk","gil jklk"}; String Score[] = {"1", "2","3", "5", "4", "3","5","5","5","5"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity2); simpleList = (ListView)findViewById(R.id.simpleListView); //ArrayAdapter arrayAdapter = new ArrayAdapter(this, R.layout.activity_listview, R.id.textView, countryList); //simpleList.setAdapter(arrayAdapter); CustomAdapter customAdapter = new CustomAdapter(getApplicationContext(),simpleList,SerialNo, flags,Names, Score); simpleList.setAdapter(customAdapter); } Button exitButton = findViewById(R.id.exitButton); exitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); // Finish the activity and return to the previous activity } }); }     in this android app code  this  Button exitButton = findViewById(R.id.exitButton); exitButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); // Finish the activity and return to the previous activity } }); }   the "seteventclick" is wrong ,whats wrong with it and how to fix it ,

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter1: Creating A Worksheet And A Chart
Section: Chapter Questions
Problem 1EYW
icon
Related questions
Question

package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

public class PlayerActivity2 extends AppCompatActivity {
ListView simpleList;
String SerialNo[] = {"1", "2", "3", "4", "5", "6","7","8","9","10"};
int flags[] = {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8, R.drawable.image9, R.drawable.image10};

String Names[] = {"mmm", "nnn", "aaa.", "bbb", "ccc", "ddd","eee jk"," ijk","Virgil jk","gil jklk"};
String Score[] = {"1", "2","3", "5", "4", "3","5","5","5","5"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity2);
simpleList = (ListView)findViewById(R.id.simpleListView);
//ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this, R.layout.activity_listview, R.id.textView, countryList);
//simpleList.setAdapter(arrayAdapter);

CustomAdapter customAdapter = new CustomAdapter(getApplicationContext(),simpleList,SerialNo, flags,Names, Score);
simpleList.setAdapter(customAdapter);
}


Button exitButton = findViewById(R.id.exitButton);
exitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); // Finish the activity and return to the previous activity
}
});
}

 

 

in this android app code 

this 

Button exitButton = findViewById(R.id.exitButton);
exitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish(); // Finish the activity and return to the previous activity
}
});
}

 

the "seteventclick" is wrong ,whats wrong with it and how to fix it ,

usage
Button exitButton = findViewById(R.id.exitButton);
exitButton.setOnClickListener(new View.OnClickListener() {
}
});
@Override
public void onClick(View v) {
finish(); // Finish the activity and return to the previous acti
}
Transcribed Image Text:usage Button exitButton = findViewById(R.id.exitButton); exitButton.setOnClickListener(new View.OnClickListener() { } }); @Override public void onClick(View v) { finish(); // Finish the activity and return to the previous acti }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning