Commit bac7ba9a authored by a-j.towse's avatar a-j.towse

working performance name display

parent b477125d
......@@ -236,16 +236,20 @@ public class DBConnector extends SQLiteOpenHelper {
Cursor cursor = db.rawQuery(query, null);
String info;
ArrayList<String> tempList = new ArrayList<>();
cursor.moveToFirst();
for (int i=0;i<cursor.getCount();i++) {
for (int x=1;x< cursor.getColumnCount();x++) {
info = cursor.getString(x);
for(int i=0;i< cursor.getCount();i++){
ArrayList<String> tempList = new ArrayList<>();
for (int column=1;column< cursor.getColumnCount();column++) {
info = cursor.getString(column);
tempList.add(info);
}
performanceInfoList.add(tempList);
cursor.moveToNext();
}
performanceInfoList.add(tempList);
cursor.moveToNext();
}
//Close DB
......
......@@ -6,6 +6,7 @@ public class IdleData {
IdleData(String name)
{
this.name = name;
}
......
......@@ -41,7 +41,8 @@ public class MainActivity extends AppCompatActivity {
ArrayList performanceInfoList = connector.getPerformanceInfo();
for (int i = 0;i<performanceInfoList.size();i++) {
performanceList.add(i, new IdleData(performanceInfoList.get(i).toString()));
ArrayList tempList = (ArrayList) performanceInfoList.get(i);
performanceList.add(performanceList.size(), new IdleData(tempList.get(0).toString()));
this.adapter.notifyItemInserted(this.adapter.getItemCount());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment