The android studio music player applet, the code is correct, but the interface is blank

After going through Baidu, I thought it was a typo in onCreate, but after checking, it didn’t

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_music);

Then I thought it was because the computer’s running memory was insufficient, so it couldn’t be displayed, but when I installed it on my Android phone, it was blank.

Then I found out that the position here was wrong.

forward:

<activity
    android:name=".SpinnerActivty"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

back:

<activity
    android:name=".MusicActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

 

 

Guess you like

Origin blog.csdn.net/weixin_52213234/article/details/127068926