Android中TextView setText int 报错

在对中TextView setText 覆值int 时报错,网上查下原因是setText整型表明是设值R.id.xxx,当然找不到。

解决方法是将int转化为string,用String.valueOf(xxx)

时间: 2024-08-04 14:25:34

Android中TextView setText int 报错的相关文章

android studio 中编译时老是报错

问题描述 android studio 中编译时老是报错 在文件中都有,但是为什么还是有错: 解决方案 http://zhidao.baidu.com/link?url=nqNjZq730FSkqIB-yNckbp0co3ENuoAoHQTY4xq4zW73Fe--x88FKQ3JiYA_R1uZhnyy9T6ERxhfOQlmrWgKkEyA4yu2nC-b4uBh2NM_Bqu 解决方案二: 报的什么错呢? 不然没法分析的

android studio中的xml文件报错,eclipse正常不报错

问题描述 android studio中的xml文件报错,eclipse正常不报错 android:background="@drawable/one_home_page_text" 这张图片确实有,错误提示 Error:(138, 41) No resource found that matches the given name (at 'background' with value '@drawable/one_home_page_text'). eclipse中不报错,倒进stu

androidlogcat问题-android程序,eclipse没报错,但是运行会意外停止

问题描述 android程序,eclipse没报错,但是运行会意外停止 我是一个初学android者,很多简单的问题大家都看着很简单而我不知道为什么,所以希望耐心的大神帮忙回答一下!我很着急~~~ 这是OtherActivity.java public class OtherActivity extends MainActivity { private Button btn1; private TextView myTextView = null; private ListView listVi

android-在安卓studio中运行项目总是报错,有人知道怎么解决吗?

问题描述 在安卓studio中运行项目总是报错,有人知道怎么解决吗? Error:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find any version that matches com.android.support:appcompat-v7:23.+. Searched

android 中使用poi jar时报错

问题描述 android 中使用poi jar时报错 我在android 项目中引入poi的jar包:poi-ooxml-schemas-3.10-FINAL-20140208.jar 一运行就报 too many method,有谁有解决办法没有?或者其它的 word转pdf的库

新手-android程序,eclipse没报错,但是运行会意外停止

问题描述 android程序,eclipse没报错,但是运行会意外停止 本人刚开始学习android,跟着书写了个程序,这个程序是会有一个东西随着手指拖动而移动,编译完没有问题,但是在手机上运行的时候却是意外停止,代码和书上写的一模一样,求大神指导 DrawView.java的代码:/** * */package com.example.customview; import android.content.Context;import android.graphics.Canvas;import

querystring-在httpclient中使用Serializable接口报错

问题描述 在httpclient中使用Serializable接口报错 public static void main(String[] args) throws IOException ClassNotFoundException { String url = ""http://localhost:8080/RmiJetty/test""; Scanner sc1 = new Scanner(System.in); String queryString1 = &q

studio-Android Studio中使用JUnit测试报错(ClassNotFoundException)

问题描述 Android Studio中使用JUnit测试报错(ClassNotFoundException) 在Android Studio中编写测试类public class MyAppTest extends ActivityInstrumentationTestCase2报错: Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter Caused by: java

c++-在windows下mingw对类中含有模板函数报错

问题描述 在windows下mingw对类中含有模板函数报错 在windows下用mingw 进行编译报错,说解析模板参数列表报错.在linux下编译正确. 代码我已经简化: #include <iostream> using namespace std; class Point{ public: //实现setPoint函数 void setPoint(int x, int y){ xPos = x; yPos = y; } //实现printPoint函数 void printPoint(