Edit:
It seems my button styles are causing the issue.
Edit Code
buttonL.setOnTouchListener(new View.OnTouchListener() {
public boolean
Try this:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread splash=new Thread(){
public void run(){
try{
sleep(2000);
}catch(Exception e){
e.printStackTrace();
}finally{
startActivity(new Intent(getApplicationContext(),StartMenu.class));
finish();
}
}
};
splash.start();
}
And your Manifest.xml:
<activity
android:name="com.example.mapcard.Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
From logcat the problem is background of your Button. I think it's somehow big image so it overflow your memory.
First
Try to remove any @drawable in menu_system.xml especially android:background in Button
Run your if it's work then you know where to look.
Second(for workaround)
Move your background image file to bigger folder
from drawable to drawable-xhdpi
I tried your code .It was working fine.I think issue is because of out of memory.Issue is with image resource ,try to set image in compressed format to avoid memory leakage.