Skip to content
Snippets Groups Projects
Commit 720f0ce0 authored by fpeterfalvi's avatar fpeterfalvi
Browse files

Bugfix: new line character corrected

Now the saved database files can be opened correctly.
parent b6911584
No related branches found
No related tags found
No related merge requests found
...@@ -247,7 +247,7 @@ public class GameActivity extends AppCompatActivity implements GameControlFragme ...@@ -247,7 +247,7 @@ public class GameActivity extends AppCompatActivity implements GameControlFragme
OutputStream outputStream = new FileOutputStream(file); OutputStream outputStream = new FileOutputStream(file);
List<Question> allQuestions = Question.listAll(Question.class); List<Question> allQuestions = Question.listAll(Question.class);
for (int i = 0; i < allQuestions.size(); i++) { for (int i = 0; i < allQuestions.size(); i++) {
outputStream.write((allQuestions.get(i).convertToString() + "\t").getBytes()); outputStream.write((allQuestions.get(i).convertToString() + "\n").getBytes());
} }
outputStream.close(); outputStream.close();
Toast.makeText(this, "Saved to: " + file.getCanonicalPath(), Toast.LENGTH_LONG).show(); Toast.makeText(this, "Saved to: " + file.getCanonicalPath(), Toast.LENGTH_LONG).show();
......
...@@ -90,6 +90,7 @@ public class QuestionListAdapter extends RecyclerView.Adapter<QuestionListAdapte ...@@ -90,6 +90,7 @@ public class QuestionListAdapter extends RecyclerView.Adapter<QuestionListAdapte
public void onClick(View view) { public void onClick(View view) {
item.setEnabled(!item.isEnabled()); item.setEnabled(!item.isEnabled());
notifyItemChanged(position); notifyItemChanged(position);
item.save();
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment