android - Parcelable no such file or directory -
hello have strange error when application write parcelable.
with code :
package com.android.edl; import java.io.ioexception; import org.xmlpull.v1.xmlserializer; import com.tools.edl.tools; import android.content.contentvalues; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.os.parcel; import android.os.parcelable; public class elementdescription implements parcelable { private int id; private string naturetext = ""; private string usuretext = ""; private string fonctionnementtext = ""; private string etattext = ""; private tools tools = new tools(); private static string table = "edl_elementdescription"; public elementdescription (parcel in) { id = in.readint(); naturetext = in.readstring(); usuretext = in.readstring(); fonctionnementtext = in.readstring(); etattext = in.readstring(); } public elementdescription () { } public int update(sqlitedatabase db) { contentvalues values = new contentvalues(); values.put("naturetext", naturetext); values.put("usuretext", usuretext); values.put("fonctionnementtext", fonctionnementtext); values.put("fonctionnement", fonctionnementtext); values.put("etattext", etattext); this.id = (int) db.insert(table, null, values); return this.id; } public void maj(sqlitedatabase db) { contentvalues values = new contentvalues(); values.put("naturetext", naturetext); values.put("usuretext", usuretext); values.put("fonctionnementtext", fonctionnementtext); values.put("fonctionnement", fonctionnementtext); values.put("etattext", etattext); db.update(table, values, "id=?", new string[] {string.valueof(id)}); } public void init(sqlitedatabase db,int id) { cursor description = db.query(table, new string[]{"naturetext","usuretext","fonctionnementtext","etattext","id"}, "id=?", new string[] {string.valueof(id)}, null, null, null); description.movetofirst(); if(description.getcount()>0) { naturetext = tools.isnull(description.getstring(0)); usuretext = tools.isnull(description.getstring(1)); fonctionnementtext = tools.isnull(description.getstring(2)); etattext = tools.isnull(description.getstring(3)); id = description.getint(4); } } public void createxml(xmlserializer xmlserializer) throws illegalargumentexception, illegalstateexception, ioexception { xmlserializer.starttag("", "description"); if(!tools.isempty(naturetext)) { xmlserializer.starttag("", "naturetext"); xmlserializer.text(naturetext); xmlserializer.endtag("", "naturetext"); } if(!tools.isempty(usuretext)) { xmlserializer.starttag("", "usuretext"); xmlserializer.text(usuretext); xmlserializer.endtag("", "usuretext"); } if(!tools.isempty(fonctionnementtext)) { xmlserializer.starttag("", "fonctionnementtext"); xmlserializer.text(fonctionnementtext); xmlserializer.endtag("", "fonctionnementtext"); } if(!tools.isempty(etattext)) { xmlserializer.starttag("", "etattext"); xmlserializer.text(etattext); xmlserializer.endtag("", "etattext"); } xmlserializer.endtag("", "description"); } public int getid() { return id; } public void setid(int id) { id = id; } public string getnaturetext() { if(naturetext==null) return ""; else return naturetext; } public void setnaturetext(string naturetext) { this.naturetext = naturetext; } public string getusuretext() { return usuretext; } public void setusuretext(string usuretext) { usuretext = usuretext; } public string getfonctionnementtext() { return fonctionnementtext; } public void setfonctionnementtext(string fonctionnementtext) { fonctionnementtext = fonctionnementtext; } public string getetattext() { return etattext; } public void setetattext(string etattext) { etattext = etattext; } @override public void writetoparcel(parcel out, int flags) { out.writeint(id); out.writestring(naturetext); out.writestring(usuretext); out.writestring(fonctionnementtext); out.writestring(etattext); } public static final parcelable.creator<elementdescription> creator = new parcelable.creator<elementdescription>() { public elementdescription createfromparcel(parcel in) { return new elementdescription(in); } public elementdescription[] newarray(int size) { return new elementdescription[size]; } }; @override public int describecontents() { // todo auto-generated method stub return 0; } }
at line "out.writestring(etattext)"
when execute application, 1 of ten when clicked on item of listview. when percelable object send other activity puts error :
"error opening trace file: no such file or directory !" in infinity loop error "cannot bind local 8700 debugger"
someone met error please?
"cannot bind local 8700 debugger"
this happens when try launch android app on device eclipse , debugger fails connect localhost @ particular port , times out.
to fix following steps in order given:
you using base local debugger port 8700. plz change 8600 or 8601 , restart eclipse , try.
you can follows:
under window -> preferences -> android -> ddms:
set base local debugger port "8600" or "8601" check box says "use adbhost" , value should "127.0.0.1"
- close eclipse
- disconnect usb cable
- kill adb instances on task manager of computer
- start eclipse
- connect usb cable
- launch application
if not make sure using ipv4 address localhost dns loopback name.
Comments
Post a Comment