0

我正在尝试从另一个活动开始一个活动,我收到一个错误并且应用程序强制关闭。这是logcat:

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();
}
}
4

1 回答 1

1

由于您没有在该日志上放置最重要的错误,我认为您没有在 AndroidManifest.xml 上定义您的活动。为了更好地检查您的错误,请从顶部开始放置所有错误日志

于 2012-10-07T08:35:14.777 回答