title: Errors in Eclipse LogCat - Android
body: <p>Can somebody help me? I'm making a simple Android app which has splash screen and main menu with a button, which should lead to the other "page" and maybe play a sound. The app starts for a second, splash screen appears then the app crashes.. I have also noticed that it takes a while for button to load the other page :</p>
  
  <p>I think this line has something to do with it :</p>
  
  <pre><code>12-05 23:36:57.710: I/ActivityManager(287): Displayed com.example.prva/.button: +1s167ms
  </code></pre>
  
  <p>And these are the red errors that appear constantly :</p>
  
  <pre><code>    12-07 14:24:28.301: E/ActivityThread(587): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d0c8d8 that was originally bound here
  12-07 14:24:28.301: E/ActivityThread(587): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d0c8d8 that was originally bound here
  12-07 14:24:28.301: E/ActivityThread(587):  at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969)
  12-07 14:24:28.301: E/ActivityThread(587):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
  12-07 14:24:28.301: E/ActivityThread(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
  12-07 14:24:28.301: E/ActivityThread(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
  12-07 14:24:28.301: E/ActivityThread(587):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
  12-07 14:24:28.301: E/ActivityThread(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
  12-07 14:24:28.301: E/ActivityThread(587):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
  12-07 14:24:28.301: E/ActivityThread(587):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  12-07 14:24:28.301: E/ActivityThread(587):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  12-07 14:24:28.301: E/ActivityThread(587):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  12-07 14:24:28.301: E/ActivityThread(587):  at java.lang.Thread.run(Thread.java:856)
  12-07 14:24:28.312: E/StrictMode(587): null
  12-07 14:24:28.312: E/StrictMode(587): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d0c8d8 that was originally bound here
  12-07 14:24:28.312: E/StrictMode(587):  at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969)
  12-07 14:24:28.312: E/StrictMode(587):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
  12-07 14:24:28.312: E/StrictMode(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
  12-07 14:24:28.312: E/StrictMode(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
  12-07 14:24:28.312: E/StrictMode(587):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
  12-07 14:24:28.312: E/StrictMode(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
  12-07 14:24:28.312: E/StrictMode(587):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
  12-07 14:24:28.312: E/StrictMode(587):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  12-07 14:24:28.312: E/StrictMode(587):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  12-07 14:24:28.312: E/StrictMode(587):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  12-07 14:24:28.312: E/StrictMode(587):  at java.lang.Thread.run(Thread.java:856)
  12-07 14:24:28.312: W/ActivityManager(273): Unbind failed: could not find connection for android.os.BinderProxy@40f409d8
  12-07 14:24:28.322: E/ActivityThread(587): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d5ed58 that was originally bound here
  12-07 14:24:28.322: E/ActivityThread(587): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d5ed58 that was originally bound here
  12-07 14:24:28.322: E/ActivityThread(587):  at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969)
  12-07 14:24:28.322: E/ActivityThread(587):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
  12-07 14:24:28.322: E/ActivityThread(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
  12-07 14:24:28.322: E/ActivityThread(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
  12-07 14:24:28.322: E/ActivityThread(587):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
  12-07 14:24:28.322: E/ActivityThread(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
  12-07 14:24:28.322: E/ActivityThread(587):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
  12-07 14:24:28.322: E/ActivityThread(587):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  12-07 14:24:28.322: E/ActivityThread(587):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  12-07 14:24:28.322: E/ActivityThread(587):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  12-07 14:24:28.322: E/ActivityThread(587):  at java.lang.Thread.run(Thread.java:856)
  12-07 14:24:28.341: E/StrictMode(587): null
  12-07 14:24:28.341: E/StrictMode(587): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d5ed58 that was originally bound here
  12-07 14:24:28.341: E/StrictMode(587):  at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:969)
  12-07 14:24:28.341: E/StrictMode(587):  at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
  12-07 14:24:28.341: E/StrictMode(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1418)
  12-07 14:24:28.341: E/StrictMode(587):  at android.app.ContextImpl.bindService(ContextImpl.java:1407)
  12-07 14:24:28.341: E/StrictMode(587):  at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
  12-07 14:24:28.341: E/StrictMode(587):  at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
  12-07 14:24:28.341: E/StrictMode(587):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
  12-07 14:24:28.341: E/StrictMode(587):  at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  12-07 14:24:28.341: E/StrictMode(587):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  12-07 14:24:28.341: E/StrictMode(587):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  12-07 14:24:28.341: E/StrictMode(587):  at java.lang.Thread.run(Thread.java:856)
  </code></pre>
  
  <p>I can post more info if needed, thank you in advance!</p>
  
  <p>My MainActivity.java :</p>
  
  <pre><code>package com.example.prva;
  
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.app.Activity;
  import android.content.Intent;
  import android.view.Menu;
  
  
  public class MainActivity extends Activity {
  
      MediaPlayer MPlayer;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.splash);        
  
          MPlayer = MediaPlayer.create(this, R.raw.splash);
          MPlayer.start();        
  
          Thread tajmer = new Thread(){
              public void run(){
                  try{
                      int tajmer = 0;
                      while(tajmer == 0)
                      {
                          sleep(3500);
                          tajmer = tajmer +1;
                      }
                  startActivity(new Intent(MainActivity.this, Meni_Splash.class));
                  } catch (InterruptedException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
  
                  finally{
                      finish();
                  }
              }           
  
          };
          tajmer.start();     
  
  
      }
  
  
  
  
      @Override
      protected void onDestroy() {
          // TODO Auto-generated method stub
          super.onDestroy();
          MPlayer.release();
      }
  
  
  
  
      @Override
      protected void onPause() {
          // TODO Auto-generated method stub
          super.onPause();
          MPlayer.pause();
      }   
  
  
  
  
      @Override
      protected void onResume() {
          // TODO Auto-generated method stub
          super.onResume();
          MPlayer.start();
      }
  
  
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>Here is a Meni_Splash.java code :</p>
  
  <pre><code>package com.example.prva;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  
  public class Meni_Splash extends Activity{
  
      MediaPlayer ButtonClick;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main); 
  
          //Button click sound
          final MediaPlayer ButtonClick = MediaPlayer.create(this, R.raw.button1);
  
  
  
          Button btnv = (Button) findViewById(R.id.buttonv);
          btnv.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  startActivity(new Intent("com.example.prva.BUTTONVELIKI"));
                  ButtonClick.start();
              }
          });
  
          Button btn3 = (Button) findViewById(R.id.buttonplay);
          btn3.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  startActivity(new Intent("com.example.prva.BUTTONPLAY"));
                  ButtonClick.start();
              }
          });
  
      }
  
  }
  </code></pre>
  
  <p>My manifest (I think i messed everything up here and everywhere else...) :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.prva"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="18" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/icon"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity            
              android:name="com.example.prva.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;              
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;  
          &lt;/activity&gt;
  
          &lt;activity
              android:name=".Meni_Splash"
              android:label="@string/app_name" &gt;
  
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;              
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;         
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>activity_main.xml :</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"
      android:background="@drawable/simplyfit"&gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="15dp"        
          android:text="@string/pozdrav" /&gt;
  
      &lt;Button
          android:id="@+id/buttonv"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="24dp"
          android:layout_alignParentBottom="true"        
          android:background="@drawable/button_v"
          android:shadowColor="#000000"
          android:shadowDx="1"
          android:shadowDy="1"
          android:shadowRadius="2"
          android:text="@string/buttonv"
          android:textColor="#FFFFFF"
          android:textSize="25sp"
          android:textStyle="bold"
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>button.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" 
      android:background="@drawable/splash"&gt;
  
       &lt;TextView
           android:id="@+id/textView5"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_gravity="center"
           android:layout_marginTop="@dimen/text2"
           android:text="@string/strana2"
           android:textSize="30sp"
           android:textStyle="bold|italic" /&gt;
  
       &lt;Button
           android:id="@+id/buttonplay"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_gravity="center"
           android:layout_marginTop="225dp"
           android:text="@string/textbuttonplay"/&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>button.java :</p>
  
  <pre><code>package com.example.prva;
  
  import android.app.Activity;
  import android.os.Bundle;
  
  public class button extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);     
          setContentView(R.layout.button);
          }
      }
  </code></pre>