In Eclipse setting classes as list view forces close - android

After following code and showing no errors when I use my button to access my list view it forces close my code is as follows
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class Listview extends ListActivity {
String classNames[] = {"home1", "Sweet", "tutorial2"};
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classNames));
}#Override
protected void onListItemClick (ListView lv, View v, int position, long id){
super.onListItemClick(lv, v, position, id);
String openClass = classNames[position];
try{
Class selected = Class.forName("us.beats.with." + openClass);
Intent selectedIntent = new Intent(this, selected);
startActivity(selectedIntent);
}catch (ClassNotFoundException e){
e.printStackTrace();
}
}

where the button was set up I had Button Listview = (Button) findViewById(R.id.Listview);
Listview.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("us.beats.with.Mylist"));
mpButtonClick.start();
but start activity was us.beats.with.Listview should have been the above

Change your classname and run it will work fine

public class MyList extends ListActivity {
String classNames[] = {"home1", "Sweet", "tutorial2"};
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classNames));
}#Override
protected void onListItemClick (ListView lv, View v, int position, long id){
super.onListItemClick(lv, v, position, id);
String openClass = classNames[position];
try{
Class selected = Class.forName("us.beats.with." + openClass);
Intent selectedIntent = new Intent(this, selected);
startActivity(selectedIntent);
}catch (ClassNotFoundException e){
e.printStackTrace();
}
}
Now run the above code

Related

Listview onItemClick Event not firing

I have set an event listener(onclick) for the listview but it is not firing.
Below is my code. I have put logcat entry as the test. But the log entry not printed and the new activity not started.
public class GetTenantList extends Activity implements OnItemClickListener {
private static String DB_NAME="meterapp.sqlite";
DatabaseHelperClass db= new DatabaseHelperClass( this,DB_NAME);
allTenants individualreadings;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tenants);
allTenants individualreadings= new allTenants(this);
ListView listview =(ListView)findViewById(R.id.tenants);
listview.setBackgroundColor(color.holo_orange_dark);
listview.setAdapter(individualreadings);
listview.setOnItemClickListener(this) ;
}
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
protected void onPause() {
db.close();
super.onPause();
}
#Override
protected void onDestroy(){
db.close();
super.onDestroy();
}
#Override
protected void onStop() {
// TODO Auto-generated method stub
db.close();
super.onStop();
}
#Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long index) {
Intent intent = new Intent(this,EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
intent.putExtra("id", tenantid);
startActivity(intent);
}
}
Any reasons why it is not responding?
Ronald
I have two versions of code suggestions
Version 1
package com.example.metermanager;
import meter.manager.helper.DatabaseHelperClass;
import meters.model.Tenants;
import android.R.color;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
public class GetTenantList extends Activity {
private static String DB_NAME="meterapp.sqlite";
DatabaseHelperClass db= new DatabaseHelperClass( this,DB_NAME);
allTenants individualreadings;
ListView listview;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tenants);
final allTenants individualreadings= new allTenants(this);
listview =(ListView)findViewById(R.id.tenants);
listview.setAdapter(individualreadings);
listview.setOnItemClickListener(new OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long id)
{
//whatever code you wish to invoke, in this case
Intent intent = new Intent(getApplicationContext(),EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
intent.putExtra("id", tenantid);
startActivity(intent);
}
});
}
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
protected void onPause() {
db.close();
super.onPause();
}
#Override
protected void onDestroy(){
db.close();
super.onDestroy();
}
#Override
protected void onStop() {
// TODO Auto-generated method stub
db.close();
super.onStop();
}
}
Version 2:
i am. Copied wrong code. Did not save it!
Both have failed.
Version 2;
package com.example.metermanager;
import meter.manager.helper.DatabaseHelperClass;
import meters.model.Tenants;
import android.R.color;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
public class GetTenantList extends Activity implements OnItemClickListener {
private static String DB_NAME="meterapp.sqlite";
DatabaseHelperClass db= new DatabaseHelperClass( this,DB_NAME);
allTenants individualreadings;
ListView listview;
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tenants);
final allTenants individualreadings= new allTenants(this);
listview =(ListView)findViewById(R.id.tenants);
listview.setAdapter(individualreadings);
listview.setOnItemClickListener(this);
}
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
protected void onPause() {
db.close();
super.onPause();
}
#Override
protected void onDestroy(){
db.close();
super.onDestroy();
}
#Override
protected void onStop() {
// TODO Auto-generated method stub
db.close();
super.onStop();
}
#Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long id)
{
//whatever code you wish to invoke, in this case
Intent intent = new Intent(getApplicationContext(),EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
intent.putExtra("id", tenantid);
startActivity(intent);
}
}
Here is the code for allTenants class.
package com.example.metermanager;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import meter.manager.helper.DatabaseHelperClass;
import meters.model.Tenants;
import meters.model.VMeterReadings;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;
public class allTenants extends BaseAdapter {
#SuppressWarnings("unused")
private Context context;
DatabaseHelperClass db;
private static String DB_NAME="meterapp.sqlite";
private List<Tenants> readings =new ArrayList<Tenants>();
DecimalFormat df = new DecimalFormat("#,###,###,###");
SimpleDateFormat fm =new SimpleDateFormat("dd-MM-yyyy",Locale.UK);
public allTenants(Context context1) {
this.context=context1;
DatabaseHelperClass db= new DatabaseHelperClass( context1,DB_NAME);
readings=db.GetAllTenants();
//close it
db.close();
}
#Override
public int getCount() {
// TODO Auto-generated method stub
return readings.size();
}
#Override
public Object getItem(int index) {
// TODO Auto-generated method stub
return getItem(index);
}
#Override
public long getItemId(int index) {
// TODO Auto-generated method stub
return index;
}
#Override
public View getView(int arg0, View view, ViewGroup parent) {
try{
if (view ==null){
LayoutInflater inflater=
LayoutInflater.from(parent.getContext());
view =inflater.inflate(R.layout.tenants_listview,parent,false);
}
Tenants reading =readings.get(arg0);
TextView tenantTextView =(TextView)
view.findViewById(R.id.textView9);
tenantTextView.setText(reading.getFirstName());
TextView surnameTextView =(TextView)
view.findViewById(R.id.textView10);
surnameTextView .setText(reading.getSurName());
TextView othernamesTextView =(TextView)
view.findViewById(R.id.textView11);
othernamesTextView .setText(reading.getOtherNames());
TextView mobile1 =(TextView)
view.findViewById(R.id.textView12);
mobile1.setText(reading.getMobile1());
TextView mobile2TextView =(TextView)
view.findViewById(R.id.textView13);
mobile2TextView.setText(reading.getMobile2());
TextView dateaddedTextView =(TextView)
view.findViewById(R.id.textView14);
dateaddedTextView.setText(fm.format((reading.getDateAdded())));
CheckBox inactiveCheckbox =(CheckBox)
view.findViewById(R.id.chkinactive);
inactiveCheckbox.setChecked(reading.getInActive());
TextView inactivedateTextView =(TextView)
view.findViewById(R.id.textView16);
inactivedateTextView.setText(fm.format(reading.getDateInActive()));
TextView tenantid =(TextView)
view.findViewById(R.id.textView17);
String test= Integer.toString(reading.get_id());
tenantid.setText(test);
}catch(Exception e)
{
Log.e("Error loading data in All Tenants listbox",e.toString());
}
return view;
}
}
Check like this:
#Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(GetTenantList.this,EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
intent.putExtra("id", tenantid);
startActivity(intent);
}
You are using just this as context.... change it to GetTenantList.this in your onItemClick. Also, you can change the intent parameters to:
#Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long index) {
Intent intent = new Intent(GetTenantList.this,EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
Bundle params = new Bundle();
params.putString("id", tenantid);
intent.putExtras(params);
startActivity(intent);
}
I think you may have misread the setOnItemClickListener() documentation/examples. Try doing it like this:
listview.setOnItemClickListener(new OnItemClickListener()
{
#Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long id)
{
//whatever code you wish to invoke, in this case
Intent intent = new Intent(getApplicationContext(),EditTenants.class);
Tenants tenant=(Tenants)individualreadings.getItem(position);
String tenantid= Integer.toString(tenant.get_id());
Log.e("Testing Intent Filter", tenantid);
intent.putExtra("id", tenantid);
startActivity(intent);
}
}
Don't forget to properly import the listener too!
Try using the ListView as member variable of the class.

How to implement a "main menu" ListView?

I have an activity that displays a list of "main menu" items. Each list item should start a new activity when clicked. I do this by loading the appropriate activity using it's class name.
Code:
public class MenuActivity extends ListActivity {
String classes[] = { "AboutUsActivity", "CompanyProfileActivity", "ProductsActivity", "ContactActivity" };
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classes));
}
#Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
String cheese = classes[position];
try {
Class ourClass = Class.forName("com.example.test." + cheese);
Intent ourIntent = new Intent(this, ourClass);
startActivity(ourIntent);
}
catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
Because I'm storing class names in the list, that is what is shown to the user, so it's not very user-friendly. How can I fix this?
For example, instead of showing "AboutUs", how can I make the list show something like "About Us" or "About Company's Name"?
Try this:
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MenuActivity extends ListActivity
{
private String[] menuItems = { "About Us", "Company Profile", "Products", "Contact" };
private String[] menuClassNames = { AboutUsActivity.class.getName(), CompanyProfileActivity.class.getName(), ProductsActivity.class.getName(), ContactActivity.class.getName() };
#Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menuItems));
}
#Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
super.onListItemClick(l, v, position, id);
try
{
Intent intent = new Intent(this, Class.forName(menuClassNames[position]));
startActivity(intent);
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
Alternatively, you could make menuClassNames a Class[], and then you wouldn't need to go the extra step of loading the class by name.
Use 2 arrays, one for the classes and other one for the names you want to display.

ListView not updated after database is changed

I'm really frustrated because of bad programming style, and inexperience in Android. Sorry to tell you guys that.
How the app works:
This is a todo app for my job training. There are 6 columns.
3 of these contain information about the todo and the other 3 contain a view detail, edit, and remove screen.
When the user clicks remove for some reason even after setting a notifyDataChange, my screen is not updated and the deleted row it's still displayed.
Any ideas of what is going on here? I've tried many solutions for about 3 hours now
The code is posted here sorry if its a bit tedious.
The whole class with the ListViews:
package com.DCWebMakers.Vairon;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.database.DataSetObserver;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CursorAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class ManageAppointment extends Activity {
ListView rowLi, whenLi, postedLi, detailsLi, editLi, removeLi;
ArrayAdapter<String> whenAdapter, postedAdapter, detailsAdapter,
editAdapter, removeAdapter;
ArrayAdapter<Integer> rowAdapter;
final AppointmentInfo information = new AppointmentInfo(this);
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
/*
* The ListViews created here are not the proper way to make ListViews.
* This is for testing purposes and will be updated for efficiency. The
* remove also doesn't work properly
*/
super.onCreate(savedInstanceState);
setContentView(R.layout.manage_appointment);
initVariables();
try {
databaseManagement();
detailsLi.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> aV, View v, int pos,
long arg3) {
// TODO Auto-generated method stub
Intent openDetails = new Intent(
"com.DCWebMakers.Vairon.APPOINTMENTDETAILS");
openDetails.putExtra("position", pos);
startActivity(openDetails);
}
});
editLi.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> aV, View v, int pos,
long arg3) {
// TODO Auto-generated method stub
Intent openEdit = new Intent(
"com.DCWebMakers.Vairon.EDITAPPOINTMENT");
openEdit.putExtra("position", pos);
startActivity(openEdit);
notifyChangesToAdapters();
}
});
removeLi.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> aV, View v, int pos,
long arg3) {
// TODO Auto-generated method stub
databaseManagement();
information.open();
information.delete(pos);
information.close();
Dialog sucDeleted = new Dialog(ManageAppointment.this);
sucDeleted.setTitle("Sucesfully deleted");
TextView tvDintWorked = new TextView(ManageAppointment.this);
tvDintWorked.setText("The appointment at position:" + pos
+ " was sucesfully deleted");
sucDeleted.setContentView(tvDintWorked);
sucDeleted.show();
notifyChangesToAdapters();
}
});
} catch (Exception e) {
Dialog showError = new Dialog(this);
showError.setTitle("Error");
TextView tvDintWorked = new TextView(this);
String error = e.toString();
tvDintWorked.setText(error);
showError.setContentView(tvDintWorked);
showError.show();
}
}
public void initVariables() {
rowLi = (ListView) findViewById(R.id.rowList);
whenLi = (ListView) findViewById(R.id.whenList);
postedLi = (ListView) findViewById(R.id.postedList);
detailsLi = (ListView) findViewById(R.id.detailsList);
editLi = (ListView) findViewById(R.id.editList);
removeLi = (ListView) findViewById(R.id.removeList);
}
#Override
protected void onPause() { // TODO Auto-generated method stub
super.onPause();
}
#Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
notifyChangesToAdapters();
}
private void notifyChangesToAdapters() {
// TODO Auto-generated method stub
rowAdapter.notifyDataSetChanged();
whenAdapter.notifyDataSetChanged();
postedAdapter.notifyDataSetChanged();
detailsAdapter.notifyDataSetChanged();
editAdapter.notifyDataSetChanged();
removeAdapter.notifyDataSetChanged();
}
#Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
Intent mainIntent = new Intent("com.DCWebMakers.Vairon.MAINMENU");
startActivity(mainIntent);
}
public void databaseManagement() {
information.open();
int primaryKey = information.getKeys();
String when[] = information.getWhen();
String posted[] = information.getPosted();
String details[] = new String[primaryKey];
Integer rowNumber[] = new Integer[primaryKey];
String edit[] = new String[primaryKey];
String delete[] = new String[primaryKey];
for (int set = 0; set < rowNumber.length; set++) {
rowNumber[set] = (set);
}
for (int set = 0; set < details.length; set++) {
details[set] = ("Details");
}
for (int set = 0; set < edit.length; set++) {
edit[set] = ("Edit");
}
for (int set = 0; set < delete.length; set++) {
delete[set] = ("Delete");
}
information.close();
rowAdapter = new ArrayAdapter<Integer>(ManageAppointment.this,
android.R.layout.simple_list_item_1, rowNumber);
whenAdapter = new ArrayAdapter<String>(ManageAppointment.this,
android.R.layout.simple_list_item_1, when);
postedAdapter = new ArrayAdapter<String>(ManageAppointment.this,
android.R.layout.simple_list_item_1, posted);
detailsAdapter = new ArrayAdapter<String>(ManageAppointment.this,
android.R.layout.simple_list_item_1, details);
editAdapter = new ArrayAdapter<String>(ManageAppointment.this,
android.R.layout.simple_list_item_1, edit);
removeAdapter = new ArrayAdapter<String>(ManageAppointment.this,
android.R.layout.simple_list_item_1, delete);
rowLi.setAdapter(rowAdapter);
whenLi.setAdapter(whenAdapter);
postedLi.setAdapter(postedAdapter);
detailsLi.setAdapter(detailsAdapter);
editLi.setAdapter(editAdapter);
removeLi.setAdapter(removeAdapter);
}
}
The delete method:
public void delete(int position) {
theDatabase.beginTransaction();
try {
theDatabase
.delete(DATABASE_TABLE, KEY_ROWID + "=" + position, null);
theDatabase.setTransactionSuccessful();
} catch (SQLiteException e) {
// TODO: handle exception
e.printStackTrace();
} finally {
theDatabase.endTransaction();
theDatabase.close();
}
}
before notifyDataSetChanged you need to remove the entry from the List
Did you see any exception when deleting from database. and you also need to delete pos entry from global list before notifying.

How to create ListMenu dynamically?

I'm working on creating a dictionary and I'm trying to create ListMenu dynamically as it is created automatically while filtering words from database alphabetically.
I created a ListMenu manually, but cannot turn it into dynamic one. Does anyone have an idea how to create the ListMenu dynamically?
Here's my code:
package ge.gtug;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class Settings extends ListActivity{
String listItems[] = {"AboutUs", "AboutApp", "Feedback"};
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(Settings.this, android.R.layout.simple_list_item_1, listItems));
}
#Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
String koba = listItems[position];
super.onListItemClick(l, v, position, id);
try{
Class myClass1 = Class.forName("ge.gtug." + koba);
Intent myIntent1 = new Intent(Settings.this, myClass1);
startActivity(myIntent1);
}catch(ClassNotFoundException e){
e.printStackTrace();
try {
Class myClass2 = Class.forName("ge.gtug." + koba);
Intent myIntent2 = new Intent(Settings.this, myClass2);
startActivity(myIntent2);
}catch(ClassNotFoundException o){
o.printStackTrace();
}
}
}
}
Instead of using an Array for storing data use a List (ArrayList, Vector, or similar). And whenever you alter the data collection you need to inform the ArrayAdapter that the data has changed - to notify the array adapter that the list has changed you call the method
ArrayList<String> listItems = new ArrayList<String>();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Settings.this, android.R.layout.simple_list_item_1, listItems);
setListAdapter(adapter);
listItems.add("new string");
adapter.notifyDataSetChanged();
http://developer.android.com/reference/android/widget/ArrayAdapter.html#notifyDataSetChanged%28%29

android development eclipse (list activity)

It has the 'class' underlined in yellow and says its a warning saying that 'Class is a raw type. References to generic type Class should be parameterized'
Class ourClass = Class.forName("com.thenewboston.jack." + cheese);
I have tried all the quick fixes and every thing. I don't know what to do. Could any one help and tell me what to do?
Here is the rest of the code and where the code is placed:
package com.thenewboston.jack;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class Menu extends ListActivity{
String classes[] = {"Startingpoint", "Example1", "Example2", "Example3"
, "Example4", "Example5", "Example6", "Example7", "Example7", "Example7"};
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(Menu.this, android.R.layout.simple_expandable_list_item_1, classes));
}
#Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
String cheese = classes[position];
try{
Class ourClass = Class.forName("com.thenewboston.jack." + cheese);
Intent ourIntent = new Intent(Menu.this, ourClass);
startActivity(ourIntent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
}
Modify like this
Class<Activity> ourClass = Class.forName("com.thenewboston.jack." + cheese);
or simply suppress this warnig using:
#SuppressWarnings("rawtypes")
above the line which is generating warning.

Categories

Resources