2014-01-15 77 views
-1

我的應用程序停止工作時,我有以下行:的Android(活動不靈需要幫助初學者)

Button chkCmd = (Button) findViewById(R.id.bResults); 
ToggleButton passTog= (ToggleButton) findViewById(R.id.toggleButtonPass); 
EditText input = (EditText) findViewById(R.id.etCommands); 
TextView display = (EditText) findViewById(R.id.textViewResults); 

,但是當它消失了它的工作原理

protected void onCreate(Bundle savedInstanceState) 
{ 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.subject); 

    Button chkCmd = (Button) findViewById(R.id.bResults); 
    ToggleButton passTog= (ToggleButton) findViewById(R.id.toggleButtonPass); 
    EditText input = (EditText) findViewById(R.id.etCommands); 
    TextView display = (EditText) findViewById(R.id.textViewResults); 
} 

任何人都可以一見的一個問題上述

+0

後subject.xml – Raghunandan

+3

可能您發佈完整的代碼和logcat的錯誤? –

回答

3
EditText display = (EditText) findViewById(R.id.textViewResults); 

TextView display = (TextView) findViewById(R.id.textViewResults); 

您需要更改顯示器的EditText,或者將它轉換爲TextView的

+0

謝謝你現在這麼明顯,一直在這一整天! – user3199540