首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >禁用set按钮后,Android my App崩溃

禁用set按钮后,Android my App崩溃
EN

Stack Overflow用户
提问于 2018-06-07 04:50:26
回答 1查看 139关注 0票数 -1

我的应用程序在我按下一个按钮后崩溃了。

我的代码:

<android.support.v7.widget.AppCompatButton
    android:id="@+id/btn_print_trans"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dp"
    android:onClick="OnClickPrintSimpleApiTest"
    android:text="PRINT"
    android:textColor="#FFFFFF" />

和:

public void OnClickPrintSimpleApiTest(View view) {
    final Button BTN_print = (Button) findViewById(R.id.btn_print_trans);
    BTN_print.setBackgroundColor(Color.GREEN);
    BTN_print.setEnabled(false);
}  
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50729393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档