mysql - How to unscape text from database in android studio -
i'm creating text view in android studio, text view empty default, fetches data mysql database. text long , contains "\n" character force line breaks. reason, text view displaying \n , there isn't line breaks. here code:
<textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:singleline="false" android:id="@+id/textview" android:layout_centerhorizontal="true" android:gravity="center" android:textalignment="center" android:layout_below="@+id/imageview3" android:layout_margintop="70dp" android:textcolor="#ffffff" android:textsize="35sp" />
here picture of app showing text no line break :( https://goo.gl/cr34cq
the text in picture edited in mysql database. displayed is.
i can provide java code , mysql database table also.
here java code fetches data mysql database.
public class main extends appcompatactivity { //phpconnection declaration textview resultview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); adview madview = (adview) findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder().build(); madview.loadad(adrequest); //phpconnection starts here strictmode.enabledefaults(); resultview = (textview) findviewbyid(r.id.textview); getdata();
---------------------debug -------------------------------
'waiting device. target device: motorola-xt1033 uploading file local path: c:\users\admin\androidstudioprojects\babynames(balochi)\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.balochibabynames.doradevelopers.babynamesbalochi installing com.balochibabynames.doradevelopers.babynamesbalochi device shell command: pm install -r "/data/local/tmp/com.balochibabynames.doradevelopers.babynamesbalochi" pkg: /data/local/tmp/com.balochibabynames.doradevelopers.babynamesbalochi success
launching application: com.balochibabynames.doradevelopers.babynamesbalochi/com.balochibabynames.doradevelopers.babynamesbalochi.splash. device shell command: start -d -n "com.balochibabynames.doradevelopers.babynamesbalochi/com.balochibabynames.doradevelopers.babynamesbalochi.splash" -a android.intent.action.main -c android.intent.category.launcher starting: intent { act=android.intent.action.main cat=[android.intent.category.launcher] cmp=com.balochibabynames.doradevelopers.babynamesbalochi/.splash }
waiting process: com.balochibabynames.doradevelopers.babynamesbalochi connected target vm, address: 'localhost:8600', transport: 'socket''
just simple stripslashes php code solved problem! myself cause no 1 else bothered here! guys atleast replied.
Comments
Post a Comment