2012-10-07 91 views
0

我正試圖從另一個活動開始活動,並收到錯誤並且應用程序強制關閉。 這裏是logcat的:開始活動的Android錯誤

10-07 11:28:35.021: E/AndroidRuntime(418): at android.app.Activity.startActivity(Activity.java:2933) 
10-07 11:28:35.021: E/AndroidRuntime(418): at com.example.higlightvoice.Boicemain$4.onClick(Boicemain.java:187) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.view.View.performClick(View.java:2485) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.view.View$PerformClick.run(View.java:9080) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.os.Handler.handleCallback(Handler.java:587) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.os.Handler.dispatchMessage(Handler.java:92) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.os.Looper.loop(Looper.java:123) 
10-07 11:28:35.021: E/AndroidRuntime(418): at android.app.ActivityThread.main(ActivityThread.java:3683) 
10-07 11:28:35.021: E/AndroidRuntime(418): at java.lang.reflect.Method.invokeNative(Native Method) 
10-07 11:28:35.021: E/AndroidRuntime(418): at java.lang.reflect.Method.invoke(Method.java:507) 
10-07 11:28:35.021: E/AndroidRuntime(418): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
10-07 11:28:35.021: E/AndroidRuntime(418): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
10-07 11:28:35.021: E/AndroidRuntime(418): at dalvik.system.NativeStart.main(Native Method) 
10-07 11:28:35.031: W/ActivityManager(61): Force finishing activity com.example.higlightvoice/.Boicemain 
10-07 11:28:35.598: W/ActivityManager(61): Activity pause timeout for HistoryRecord{40589670 com.example.higlightvoice/.Boicemain} 
10-07 11:28:46.781: W/ActivityManager(61): Activity destroy timeout for HistoryRecord{40589670 com.example.higlightvoice/.Boicemain} 
10-07 11:29:04.002: D/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol 

在這裏,這是我的代碼,我怎麼稱呼活動:

Intent intent=new Intent(Boicemain.this,draw.class); 
      startActivity(intent); 

這是我的活動我打電話:

public class draw extends Activity { 
drawview drawView; 

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    // Set full screen view 
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
            WindowManager.LayoutParams.FLAG_FULLSCREEN); 
    requestWindowFeature(Window.FEATURE_NO_TITLE); 

    drawView = new drawview(this); 
    setContentView(drawView); 
    drawView.requestFocus(); 
} 
} 
+2

你錯過了實際的異常(logcat stacktrace的第一行)... – nneonneo

+0

你需要爲我們提供'Boicemain.onPause()'和'Boicemain.onDestroy()'方法的源代碼 – HitOdessit

+0

i haven' t實現onPause或onDestroy方法! –

回答

1

因爲你沒有把最重要的錯誤放在該日誌上,我想你沒有在你的AndroidManifest.xml中定義你的活動。爲了更好地檢查你的錯誤,請把所有的錯誤日誌從頂部開始

+0

坦克,這解決了我的問題,這是一個新手的錯誤 –