java - The type MySimpleAdapter is already defined -
this class defined in java file called "explenses_act.java". need able function in file called "incomes_act.java". android app. how can this?
class mysimpleadapter extends arrayadapter<string> { private final context context; private final arraylist<string> values; public mysimpleadapter(context context, list<string> values) { super(context, r.layout.custom_row, values); this.context = context; this.values = (arraylist<string>) values; } @override public view getview(int position, view convertview, viewgroup parent) { layoutinflater inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); view rowview = inflater.inflate(r.layout.custom_row, parent, false); textview textview1 = (textview) rowview.findviewbyid(r.row.date); textview textview2 = (textview) rowview.findviewbyid(r.row.time); textview textview3 = (textview) rowview.findviewbyid(r.row.desc); textview textview4 = (textview) rowview.findviewbyid(r.row.val); textview textview5 = (textview) rowview.findviewbyid(r.row.cat); string[] split = values.get(position).split(";"); final string prefs_name = "sets"; sharedpreferences settings = context.getsharedpreferences(prefs_name, 0); textview1.settext(split[0] + " "); textview2.settext(split[1] + " "); textview3.settext(split[2] + " "); textview4.settext(settings.getstring("selectedcur", "ˆ")+split[3] + " "); textview5.settext(split[4] + " "); return rowview;
} }
make mysimpleadapter class public. think existing adapter class in different package. default access modifier of classes package allows classes in package access it.
Comments
Post a Comment