Android 台灣中文網

標題: 程式沒辦法開啟 [打印本頁]

作者: jeteriza    時間: 2013-11-17 22:11
標題: 程式沒辦法開啟
煩請大大幫忙,小弟是最近剛開始碰的超級新手,試著寫第一個程式,但是在ECLIPSE上DUBUG都沒有錯誤了,但是在模擬器上安裝完後,卻沒辦法開啟,開如何解決呢?是沒有正確呼叫到活動嗎?還是還有其他地方要注意的嗎?

APP project target: android 4.2.2 api17
使用的模擬器 :  android 4.2.2 api17



LAYOUT 內容:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textview1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/tv01" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/bt01" />

</LinearLayout>



JAVA程式內容:

package jeter.iza;
import com.Jeter.iza.*;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.app.Activity;
import android.widget.TextView;

public class main_IZA extends Activity {
       
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);

                final Button button1 = (Button)findViewById(R.id.button1);
                final TextView textView1 = (TextView)findViewById(R.id.textview1);
   
   
                button1.setOnClickListener(new Button.OnClickListener(){

            @Override
            public void onClick(View v) {

            // TODO Auto-generated method stub

            textView1.setText("OK~!");

        }
           
    });
        
        }
}   




歡迎光臨 Android 台灣中文網 (https://apk.tw/) Powered by Discuz! X3.1