Android emulator crashes when opening app in 2.2 but not in 1.6
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6577914/application-works-in-android-emulator-1-6-but-crashes-on-2-2">Application works in android emulator 1.6 but crashes on 2.2</a>  </p>
</blockquote>



<p>I was wondering how i can get it to no longer crash on startup on android 2.2. It works perfectly well in android 1.6</p>

<p>REQUEST STACKTRACE:</p>

<pre><code>    [2011-07-04 20:52:37 - SDK Manager] Created AVD 'google2-2' based on Google APIs (Google Inc.), ARM (armeabi) processor,
[2011-07-04 20:52:37 - SDK Manager] with the following hardware config:
[2011-07-04 20:52:37 - SDK Manager] hw.lcd.density=240
[2011-07-04 20:52:37 - SDK Manager] vm.heapSize=24
[2011-07-04 20:55:46 - Orbs] ------------------------------
[2011-07-04 20:55:46 - Orbs] Android Launch!
[2011-07-04 20:55:46 - Orbs] adb is running normally.
[2011-07-04 20:55:46 - Orbs] Performing com.synamegames.orbs.OrbsActivity activity launch
[2011-07-04 20:55:54 - Orbs] Uploading Orbs.apk onto device 'emulator-5554'
[2011-07-04 20:55:57 - Orbs] Installing Orbs.apk...
[2011-07-04 20:56:02 - Orbs] ------------------------------
[2011-07-04 20:56:02 - Orbs] Android Launch!
[2011-07-04 20:56:02 - Orbs] adb is running normally.
[2011-07-04 20:56:02 - Orbs] Performing com.synamegames.orbs.OrbsActivity activity launch
[2011-07-04 20:56:04 - Orbs] Success!
[2011-07-04 20:56:04 - Orbs] Starting activity com.synamegames.orbs.OrbsActivity on device emulator-5554
[2011-07-04 20:56:08 - Orbs] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.synamegames.orbs/.OrbsActivity }
[2011-07-04 20:56:08 - Orbs] Application already deployed. No need to reinstall.
[2011-07-04 20:56:08 - Orbs] Starting activity com.synamegames.orbs.OrbsActivity on device emulator-5554
[2011-07-04 20:56:12 - Orbs] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.synamegames.orbs/.OrbsActivity }
</code></pre>

<p>CustomTouchListener.java:</p>

<pre><code>    package com.synamegames.orbs;

import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;

public class CustomTouchListener implements View.OnTouchListener {     
    public boolean onTouch(View view, MotionEvent motionEvent) {

        switch(motionEvent.getAction()){            
            case MotionEvent.ACTION_DOWN:
             ((TextView) view).setTextColor(0xFF4F4F4F); 
                break;          
            case MotionEvent.ACTION_CANCEL:             
            case MotionEvent.ACTION_UP:
            ((TextView) view).setTextColor(0xFFCDCDCD);
                break;
        } 

        return false;   
    } 
}
</code></pre>

<p>OrbsActivity.Java:</p>

<pre><code>    package com.synamegames.orbs;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;

public class OrbsActivity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */

    public static final String PREFS_NAME = "sampleGameSettings";       
    public static Typeface tf;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        tf = Typeface.createFromAsset(getAssets(),"data/fonts/gothlic.tff");

        TextView tv = (TextView) findViewById(R.id.start);
        TextView tv1 = (TextView) findViewById(R.id.settings);
        TextView tv2 = (TextView) findViewById(R.id.feedback);
        TextView tv3 = (TextView) findViewById(R.id.credits);
        TextView tv4 = (TextView) findViewById(R.id.exit);

        tv.setTypeface(tf);
        tv1.setTypeface(tf);
        tv2.setTypeface(tf);
        tv3.setTypeface(tf);
        tv4.setTypeface(tf);

        tv.setOnTouchListener(new CustomTouchListener());
        tv1.setOnTouchListener(new CustomTouchListener());
        tv2.setOnTouchListener(new CustomTouchListener());
        tv3.setOnTouchListener(new CustomTouchListener());
        tv4.setOnTouchListener(new CustomTouchListener());

        tv.setOnClickListener(this);
        tv1.setOnClickListener(this);
        tv2.setOnClickListener(this);
        tv3.setOnClickListener(this);
        tv4.setOnClickListener(this);        

        Toast.makeText(this, "Welcome to the Orbs Demo", Toast.LENGTH_LONG).show();

    }

    @Override
    public void onClick(View v) {

        switch(v.getId()){
            case R.id.start:

                break;
            case R.id.settings:
                Intent settings = new Intent(this, SettingsActivity.class);
                startActivity(settings);
                break;
            case R.id.feedback:
                Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
                String aEmailList[] = { "support@synamegames.com" }; 
                emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, aEmailList);
                emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Feedback on Orbs");  
                emailIntent.setType("plain/text"); 
                startActivity(Intent.createChooser(emailIntent, "Send by using"));
                break;
            case R.id.credits:

                break;  
            case R.id.exit:
                finish();
                break;
        }

    }

}
</code></pre>

<p>Main.xml
    
      </p>

<pre><code>   &lt;LinearLayout
        android:orientation="vertical"
        android:layout_margin="10dp"
        android:paddingTop="35dp"
        android:layout_width="200dp"
        android:layout_gravity="center" android:layout_height="250dp"&gt;

       &lt;TextView android:layout_gravity="left"
                 android:text="NEW GAME"
                 android:id="@+id/start"
                 style="@style/MenuFont"&gt;&lt;/TextView&gt;

        &lt;TextView
            android:text="SETTINGS"
            android:id="@+id/settings"
            style="@style/MenuFont" /&gt;

        &lt;TextView
            android:text="FEEDBACK"
            android:id="@+id/feedback"
            style="@style/MenuFont" /&gt; 

        &lt;TextView
            android:text="CREDITS"
            android:id="@+id/credits"
            style="@style/MenuFont" /&gt;  

        &lt;TextView
            android:text="EXIT GAME"
            android:id="@+id/exit"
            style="@style/MenuFont" /&gt; 

    &lt;/LinearLayout&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>Styles.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;
    &lt;style name="MenuFont"&gt;
        &lt;item name="android:textSize"&gt;20sp&lt;/item&gt;
        &lt;item name="android:textColor"&gt;#CDCDCD&lt;/item&gt;
        &lt;item name="android:textStyle"&gt;normal&lt;/item&gt;
        &lt;item name="android:clickable"&gt;true&lt;/item&gt;
        &lt;item name="android:layout_weight"&gt;1&lt;/item&gt;
        &lt;item name="android:gravity"&gt;left|center&lt;/item&gt;
        &lt;item name="android:paddingLeft"&gt;35dp&lt;/item&gt;
        &lt;item name="android:layout_width"&gt;175dp&lt;/item&gt; 
        &lt;item name="android:layout_height"&gt;fill_parent&lt;/item&gt;
    &lt;/style&gt;
&lt;/resources&gt;
</code></pre>
