Android 设置EditText的文本时,应用程序崩溃
为什么每当我试图更改EditText的文本时,我的应用程序总是崩溃?我试过了 celc=(EditText)findViewById(R.id.cel); far=(EditText)findViewById(R.id.fa); Ran=(EditText)findViewById(R.id.Ran); 开尔文=(编辑文本)findviewbyd(R.id.kev)Android 设置EditText的文本时,应用程序崩溃,android,android-edittext,Android,Android Edittext,为什么每当我试图更改EditText的文本时,我的应用程序总是崩溃?我试过了 celc=(EditText)findViewById(R.id.cel); far=(EditText)findViewById(R.id.fa); Ran=(EditText)findViewById(R.id.Ran); 开尔文=(编辑文本)findviewbyd(R.id.kev) celc.addTextChangedListener(新的TextWatcher(){ 也许您没有将视图对象与java对象链接
celc.addTextChangedListener(新的TextWatcher(){
也许您没有将视图对象与java对象链接 您使用findViewById方法进行了此操作 您的布局文件:
<EditText ... android:id="@+id/edittext" />
在方法onCreate上:
edittext = (EditText) findViewById(R.id.editText);
致以最诚挚的问候!也许您没有将视图对象与java对象链接起来 您使用findViewById方法进行了此操作 您的布局文件:
<EditText ... android:id="@+id/edittext" />
在方法onCreate上:
edittext = (EditText) findViewById(R.id.editText);
致以最诚挚的问候!也许您没有将视图对象与java对象链接起来 您使用findViewById方法进行了此操作 您的布局文件:
<EditText ... android:id="@+id/edittext" />
在方法onCreate上:
edittext = (EditText) findViewById(R.id.editText);
致以最诚挚的问候!也许您没有将视图对象与java对象链接起来 您使用findViewById方法进行了此操作 您的布局文件:
<EditText ... android:id="@+id/edittext" />
在方法onCreate上:
edittext = (EditText) findViewById(R.id.editText);
致以最良好的祝愿
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("Google is your friend.", TextView.BufferType.EDITABLE);
或使用+,字符串连接运算符:
ed = (EditText) findViewById (R.id.box);
int x = 10;
ed.setText(""+x);
或
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("Google is your friend.", TextView.BufferType.EDITABLE);
或使用+,字符串连接运算符:
ed = (EditText) findViewById (R.id.box);
int x = 10;
ed.setText(""+x);
或
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("Google is your friend.", TextView.BufferType.EDITABLE);
或使用+,字符串连接运算符:
ed = (EditText) findViewById (R.id.box);
int x = 10;
ed.setText(""+x);
或
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("Google is your friend.", TextView.BufferType.EDITABLE);
或使用+,字符串连接运算符:
ed = (EditText) findViewById (R.id.box);
int x = 10;
ed.setText(""+x);
或
我们怎么知道既没有代码也没有堆栈跟踪?所以我要说“是小精灵干的”。请提供一个演示您的问题的示例。在这种情况下,请发布堆栈跟踪中引用的代码。输入您的logcat错误。Android RunTime@deepakgoyal我们应该如何知道既没有代码也没有堆栈跟踪?所以我将使用“小精灵做到了”。请提供一个演示您的问题的示例。在这种情况下,请发布堆栈跟踪中引用的代码。输入您的logcat错误。Android RunTime@deepakgoyal我们应该如何知道既没有代码也没有堆栈跟踪?所以我将使用“小精灵做到了”。请提供一个演示您的问题的示例。在这种情况下,请发布堆栈跟踪中引用的代码。输入您的logcat错误。Android RunTime@deepakgoyal我们应该如何知道既没有代码也没有堆栈跟踪?所以我将使用“小精灵做到了”。请提供一个演示您的问题的示例。在这种情况下,请发布,以及堆栈跟踪中引用的代码。将您的logcat错误放入日志。Android RunTime@DeepakGoyal