Android – oncreate() was not called

I've just encountered a very strange problem, and I've spent hours trying to solve it. When I try to run my Android application (on my phone and simulator), I get nothing. The activity tag (Android: label = "@ string / list_name") in the androidmanifest file is set correctly, but I just have a flashing screen

I inserted a breakpoint and 30 log. D() after super() of oncreate() method, but I never reached the breakpoint and never printed log. D(). In addition, I didn't have any exceptions in logcat

The application has worked before, and I don't know how it never reached the breakpoint

PS: This is my main activity

PS2: I have cleaned up the project, rebuilt it and restarted it. The problem does not disappear:(

PS3: my oncreate() is very long, but this is where it starts:

@Override
public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.episode);
        Log.d("Very Strange", "This is never printed");
        Log.d("Very Strange", "This is never printed");
        // no breakpoints is every reached

My manifest file can be found here: http://pastebin.com/UcKbYeGC

resolvent:

Try this:

 public void onCreate(Bundle savedInstanceState)
 {
    Log.d("Very Strange", "Printed #1?");
    super.onCreate(savedInstanceState);
    Log.d("Very Strange", "Printed #2?");
    setContentView(R.layout.episode);
    Log.d("Very Strange", "This is never printed");
    Log.d("Very Strange", "This is never printed");

Just an off topic tip: use the version control system to ensure that you can roll back or compare work with the current version

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>