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

working performance name display

parent b477125d
...@@ -236,13 +236,17 @@ public class DBConnector extends SQLiteOpenHelper { ...@@ -236,13 +236,17 @@ public class DBConnector extends SQLiteOpenHelper {
Cursor cursor = db.rawQuery(query, null); Cursor cursor = db.rawQuery(query, null);
String info; String info;
ArrayList<String> tempList = new ArrayList<>();
cursor.moveToFirst(); cursor.moveToFirst();
for (int i=0;i<cursor.getCount();i++) {
for (int x=1;x< cursor.getColumnCount();x++) { for(int i=0;i< cursor.getCount();i++){
info = cursor.getString(x);
ArrayList<String> tempList = new ArrayList<>();
for (int column=1;column< cursor.getColumnCount();column++) {
info = cursor.getString(column);
tempList.add(info); tempList.add(info);
} }
performanceInfoList.add(tempList); performanceInfoList.add(tempList);
cursor.moveToNext(); cursor.moveToNext();
......
...@@ -6,6 +6,7 @@ public class IdleData { ...@@ -6,6 +6,7 @@ public class IdleData {
IdleData(String name) IdleData(String name)
{ {
this.name = name; this.name = name;
} }
......
...@@ -41,7 +41,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -41,7 +41,8 @@ public class MainActivity extends AppCompatActivity {
ArrayList performanceInfoList = connector.getPerformanceInfo(); ArrayList performanceInfoList = connector.getPerformanceInfo();
for (int i = 0;i<performanceInfoList.size();i++) { 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()); 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