android - Textview changes on AVD but not on smartphone -
android - Textview changes on AVD but not on smartphone -
i've made app in wich when press button clear textview command
textv.settext("")
but works on avd not on real smartphone utilize galaxy s4 version 5.0.1 code this..it's many imagebuttons 2 buttons , textview ..the onclick of textview @ end
package com.fanis.math; import android.app.activity; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imagebutton; import android.widget.textview; public class myresistance extends activity implements onclicklistener { view b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12; button bok, bclear; textview t; int k = -1; int[] ar = new int[4]; double n = 0; double multi=0; string nstring; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.resistance); b1 = (imagebutton) findviewbyid(r.id.im1); b2 = (imagebutton) findviewbyid(r.id.im2); b3 = (imagebutton) findviewbyid(r.id.im3); b4 = (imagebutton) findviewbyid(r.id.im4); b5 = (imagebutton) findviewbyid(r.id.im5); b6 = (imagebutton) findviewbyid(r.id.im6); b7 = (imagebutton) findviewbyid(r.id.im7); b8 = (imagebutton) findviewbyid(r.id.im8); b9 = (imagebutton) findviewbyid(r.id.im9); b10 = (imagebutton) findviewbyid(r.id.im10); b11 = (imagebutton) findviewbyid(r.id.im11); b12 = (imagebutton) findviewbyid(r.id.im12); bok = (button) findviewbyid(r.id.ok); bclear = (button) findviewbyid(r.id.clear); t = (textview) findviewbyid(r.id.tv1); b1.setonclicklistener(this); b2.setonclicklistener(this); b3.setonclicklistener(this); b4.setonclicklistener(this); b5.setonclicklistener(this); b6.setonclicklistener(this); b7.setonclicklistener(this); b8.setonclicklistener(this); b9.setonclicklistener(this); b10.setonclicklistener(this); b11.setonclicklistener(this); b12.setonclicklistener(this); bok.setonclicklistener(this); bclear.setonclicklistener(this); } @override public void onclick(view v) { // todo auto-generated method stub switch (v.getid()) { case r.id.im1: k += 1; ar[k] = 0; // dianisma pou krataei kathe psifio break; case r.id.im2: k += 1; ar[k] = 1; break; case r.id.im3: k += 1; ar[k] = 2; break; case r.id.im4: k += 1; ar[k] = 3; break; case r.id.im5: k += 1; ar[k] = 4; break; case r.id.im6: k += 1; ar[k] = 5; break; case r.id.im7: k += 1; ar[k] = 6; break; case r.id.im8: k += 1; ar[k] = 7; break; case r.id.im9: k += 1; ar[k] = 8; break; case r.id.im10: k += 1; ar[k] = 9; break; case r.id.im11: k += 1; multi = 0.01; break; case r.id.im12: k += 1; multi = 0.1; break; case r.id.ok: (int = 1; <= k; i++) { n = n + ar[i - 1] * math.pow(10, k - i); } if (multi == 0) { multi = math.pow(10, ar[k]); } n = n * multi; nstring = string.valueof(n) + "" + "Ω"; t.settext(nstring); break; case r.id.clear: t.settext(""); n = 0; k = -1; multi=0; } } }
android eclipse textview avd
Comments
Post a Comment