java - Beginner Android Strings textView: How to store, display and toggle -> Flashcard app -
java - Beginner Android Strings textView: How to store, display and toggle -> Flashcard app -
i need help storing , displaying strings of text in flashcard app. plan when user taps on textview (flashcard_front) toggles flashcard_back, , able navigate between different flashcards (front+back):
screenshot
ideally maintain strings on array in future users can add together new strings (cards) , navigate thru them.
public class mainactivity extends activity { button closebutton, addbutton, prevbutton, nextbutton; textview question, answer; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_splash); closebutton = (button) findviewbyid(r.id.closebutton); addbutton = (button) findviewbyid(r.id.plusbutton); prevbutton = (button) findviewbyid(r.id.prevbutton); nextbutton = (button) findviewbyid(r.id.nextbutton); question = (textview) findviewbyid(r.id.fcfront_textview); reply = (textview) findviewbyid(r.id.fcfront_textview); //not linked anywhere atm //adicionado nextbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { toast.maketext(getapplicationcontext(), "hello toast test!", toast.length_long).show(); } }); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); homecoming true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); if (id == r.id.action_settings) { homecoming true; } homecoming super.onoptionsitemselected(item); } public void onplusbuttonclick(view view) { } public void onclosebuttonclick(view view) { string close_msg = "thanks trying !! " ; toast.maketext(this, close_msg, toast.length_short).show(); } public void onnextbuttonclick(view view) { } public void onprevbuttonclick(view view) { } }
you in lot of different ways, utilize hashmap, allows store key value of key (a word key, , definition value), create sqlite database cards stored on device , reloadable on each start of app.
i recommend looking sqlite database allow add, delete, update cards. info stored on device there long app is.
java android xml android-activity
Comments
Post a Comment