My application's text and size becomes smaller and smaller until it finally crashes. Why?
I am using Samsung Galaxy S 4G (the new one). Previously, I tested this on the Dell Streak Tablet phone, as well as the HTC Desire, and it performed perfectly.
But now, when I start the application things are misaligned, and as I use the application the text becomes smaller and smaller, the graphics become skewed, until finally the app crashes.
Why is this? And how can I fix it?
I am NOT changing the size of anything ... like I said, I've used the same application on two other devices and nothing has made a difference. I am currently thinking it maybe has to do with the Manifest file, an SDK version issue? I read about a similar issue when someone changed language, the text got smaller, which was fixed with
<uses-sdk android:minSdkVersion="integer">
so I am looking into that.
Edit: The logcat output:
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): FATAL EXCEPTION: main
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): java.lang.RuntimeException: Unable to start activity ComponentInfo{a.company.organization/a.company.organization.travel.TravelTab}: java.lang.RuntimeException: Unable to start activity ComponentInfo{a.company.organization/a.company.organization.travel.TravelMap}: android.view.InflateException: Binary XML file line #130: Error inflating class <unknown>
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.os.Handler.dispatchMessage(Handler.java:99)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.os.Looper.loop(Looper.java:123)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at java.lang.reflect.Method.invokeNative(Native Method)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at java.lang.reflect.Method.invoke(Method.java:521)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at dalvik.system.NativeStart.main(Native Method)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{a.company.organization/a.company.organization.travel.TravelMap}: android.view.InflateException: Binary XML file line #130: Error inflating class <unknown>09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at a.company.organization.tabcontrol.TabBarActivity.displayCurrentScreen(TabBarActivity.java:159)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at a.company.organization.tabcontrol.TabBarActivity.displayCurrentScreen(TabBarActivity.java:137)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at a.company.organization.tabcontrol.TabBarActivity.setCurrentTab(TabBarActivity.java:422)
09-21 15开发者_开发百科:18:34.301: ERROR/AndroidRuntime(7377): at a.company.organization.tabcontrol.TabBarActivity.onCreate(TabBarActivity.java:369)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): ... 11 more
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): Caused by: android.view.InflateException: Binary XML file line #130: Error inflating class <unknown>
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at a.company.organization.travel.TravelMap.onCreate(TravelMap.java:66)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): ... 20 more
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): Caused by: java.lang.reflect.InvocationTargetException
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.widget.ImageView.<init>(ImageView.java:108)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at java.lang.reflect.Constructor.constructNative(Native Method)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): ... 32 more
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/carousel_top_bar.png from drawable resource ID #0x7f020087
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.content.res.Resources.loadDrawable(Resources.java:1714)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.widget.ImageView.<init>(ImageView.java:118)
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): ... 36 more
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): Caused by: java.lang.IllegalArgumentException: width and height must be > 0
09-21 15:18:34.301: ERROR/AndroidRuntime(7377): at android.graphics.Bitmap.nativeCreate(Nati
09-21 15:18:34.313: WARN/ActivityManager(6572): Force finishing activity a.company.organization/.travel.TravelTab
09-21 15:18:34.316: ERROR/(6572): Dumpstate > /data/log/dumpstate_app_error
To fix this issue, you should restrict the sdk version. To do that for 2.0 and above add:
<uses-sdk android:minSdkVersion="5" android:maxSdkVersion="5" />
You should also modify the Manifest file to include:
<supports-screens android:smallScreens="true"
android:largeScreens="true" android:resizeable="false"
android:normalScreens="true" android:anyDensity="true"></supports-screens>
The resources I used for finding out about is here, and for API Level to Platform level check I used this
精彩评论