How to convert type long to type String ? To solve : 'Encode(java.lang.string)' in android.net.Uri cannot be applied to long -
i developing android app in data taken json. , generating listview through baseadapter. when click number (textview
), need make phone call number. have tried follows
//initialization public long abc; in getview(int position, view convertview, viewgroup parent) { abc = m.getnumber(); number.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent out = new intent(intent.action_call); out.setdata(uri.parse("tel:" + uri.encode(abc))); context.startactivity(out); } }); return convertview; }
error getting 'encode(java.lang.string)' in android.net.uri cannot applied long.
actually mean? how solve problem?
your abc variable long. convert string error saying "encode(java.lang.string)' in android.net.uri cannot applied long"
intent out = new intent(intent.action_call); out.setdata(uri.parse("tel:" + uri.encode(string.valueof(abc)))); context.startactivity(out);
Comments
Post a Comment