2 Replies - 457 Views - Last Post: 07 June 2014 - 02:24 PM

#1 zaind  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 10-December 12

Application crashes when moving from one view to another. Android stud

Posted 06 June 2014 - 03:35 PM

So I've been working on a music player in android studio and I've created two java classes. One for Main Start Screen(StartScreen.Java) and one for the main player (player.Java). I have an onClicl event associated with a button as shown below.

public void onclick(View view) {

    Intent detailIntent = new Intent(this, main_player.class);
    startActivity(detailIntent);
}




The code for the second Java Class is as below. There is nothing in the java class as for now.

package com.example.musicplayer.app;

import android.app.Activity;
import android.os.Bundle;

public class main_player extends Activity {

protected void onCreate(Bundle savedInstanceState) {

    setContentView(R.layout.player);

}
}




The code in the manifest is as below.


    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".StartScreen"
        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=".main_player"
        android:label="@string/main_player"
        android:parentActivityName=".StartScreen">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".StartScreen"/>
    </activity>



Can you please tell me where is the actual mistake because the app works fine until i click the button that is suppose to take me to the main player screen?

Thank You

Is This A Good Question/Topic? 0
  • +

Replies To: Application crashes when moving from one view to another. Android stud

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10823
  • View blog
  • Posts: 40,354
  • Joined: 27-December 08

Re: Application crashes when moving from one view to another. Android stud

Posted 07 June 2014 - 01:24 PM

Moved to Android.
Was This Post Helpful? 0
  • +
  • -

#3 SuperProgrammer  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 57
  • Joined: 17-April 14

Re: Application crashes when moving from one view to another. Android stud

Posted 07 June 2014 - 02:24 PM

Could you please show the exception in the VM if there is one or the log?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1