• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Explicit Intent is executing, but only loads the layout, not the onCreate method

This is my first android app attempt after reading "Android 2 Application Development" and lots of stuff online.

Here is the relevant code:

from MovieRatingsActivity.java [my main]

Intent i = new Intent(MovieRatingsActivity.this, DisplayMovies.class);

startActivity(i);

from Manifest:
<activity
android:name=".MovieRatingsActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".DisplayMovies"
android:label="Display Movies" >

</activity>

note: i do not have any intent filters for the second activity. Do I need any if it is an explicit intent that I never plan on interacting with another application? I have tried with multiple combinations of different intent filters just out of spite, but its hard to have this answered, as every source I go to jumps to implicit intents and doesn't answer this question.

As for behavior:

Whether in debug mode, or run mode, when I click on the button and create the intent, the emulator switches to the second activity and displays the label at the top, but nothing else. Worse, in debugger mode, when I try to step-into startActivity(i), it just suspends the main thread and goes no where. Do you need a special debug technique for when jumping to next activity?

There is a chance that my intents are fine, my logic to display the list is wrong, but even still, I would like to be able to reach the code in the debugger. I also added a System.out.printline at the beginning of the second activities OnCreate method that is not executing.
 
Back
Top Bottom