android - Want to copy SQL Database info and paste into new Activity -



android - Want to copy SQL Database info and paste into new Activity -

i have 2 activities. 1 shows user database info particular entry, , there can take edit entry.

i want add together feature of copying existing info , starting new entry old info wont have input same info again.

i have tried using sharedprefs got nowhere. here can shed lite on proper coding etiquette.

i'll best detailed in description

this code start whole new entry.....

public boolean onoptionsitemselected(menuitem item) { intent addcontact = new intent(crlist.this, craetune.class); startactivity(addcontact); homecoming super.onoptionsitemselected(item); }

then class edit new entry , code i'm using save it...

private void savecontact() { crdbcon dbconnector = new crdbcon(this); if (getintent().getextras() == null) { dbconnector.insertcontact( caret.gettext().tostring(),//1 lapet.gettext().tostring(), trket.gettext().tostring());

this class view entry, , subsequently can edit need able re-create new entry...

case r.id.edititem: intent addeditcontact = new intent(this, craetune.class); addeditcontact.putextra(crlist.row_iid, rowid); addeditcontact.putextra("car", car.gettext()); addeditcontact.putextra("lap", lap.gettext()); startactivity(addeditcontact); homecoming true;

if isnt plenty info allow me know in comments...i'm pretty lost here...not sure desired result. ahead of time...

well best way think pass contact id addcontact activity. populate using id, load user data, , run save new item. (e.g. dbconnection.addcontact(..,..,contact,stuff..);)

this allow person create changes wanted contact or alter nothing.

android sql copy-paste duplicate-data

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -