Benim splash ekran benim android app gösteriliyor .... oynamak için bir ses dosyası almaya çalışıyorum. benim app çalıştırdığınızda şimdi birkaç saat ..... sadece hep birlikte Sreen sıçrama atlar şimdi burada android splash ekranında (android stüdyo) oynamak için ses alamıyorum (android stüdyo)
benim SplashScreen.java İştepackage com.skapaidbeats.app.skapaidbeats;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import com.skapaidbeats.app.skapaidbeats.MainActivity;
import com.skapaidbeats.app.skapaidbeats.R;
public class SplashScreen extends Activity {
MediaPlayer music;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timerThread = new Thread(){
public void run(){
try{
music= MediaPlayer.create(SplashScreen.this, R.raw.sound);
music.start();
sleep(3000);
}catch(InterruptedException e){
e.printStackTrace();
}finally{
Intent intent = new Intent(SplashScreen.this,MainActivity.class);
startActivity(intent);
}
}
};
timerThread.start();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
music.release();
finish();
}
}
benim AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
package="com.skapaidbeats.app.skapaidbeats">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashScreen"
android:screenOrientation="portrait"
android:label="@string/icon_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.startapp.android.publish.list3d.List3DActivity"
android:theme="@android:style/Theme" />
<activity
android:name="com.startapp.android.publish.AppWallActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.startapp.android.publish.OverlayActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Translucent" />
<activity
android:name="com.startapp.android.publish.FullScreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme" />
</application>
</manifest>
olduğunu
Uygulamanız çalışıyor deneyebilirsiniz. Sadece günlükleri yazdırmayı deneyin. Veya istisnalar için logcat'i kontrol edin. Ayrıca müzik dosyasının ham klasörde olup olmadığını da kontrol edin. Süre sadece 3 saniyedir, açılış ekranı hemen kapanır. <: "SplashScreen" = isim android: aktivite android screenOrientation = "portre" android: label = "@ string/icon_name"> –