Android Standard ListView Item doesn't enlarge on long text - android

i have a problem using the standard android listview. if the text is to long to be displayed in one listview item i would like, that this item enlarges itself.
here is a screenshot of how it looks like now:
http://www.abload.de/image.php?img=unbenanntdjupi.png
i'm using also another listview with a custom layout, there it's no problem: the listview-item enlarges itself.
fyi: im using actionbarsherlock so i extend my activity from 'SherlockListActivity'.
i hope one of you can help me... because of implementing a custom listview in this case is a huge overhead :/
thanks in advance!
// edit: it's the standard "simple_list_item_single_choice"... actually i don't want to customize it.
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/text1"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
/>
here's the code how i added it to my layout:
<ListView
android:id="#id/android:list"
android:layout_height="0dip"
android:layout_width="fill_parent"
android:layout_weight="1" />
// edit after implementing iturki's answer:
it solves the problem for android 4.x but not on devices with android level 10.
Exception:
08-30 14:25:04.049: E/AndroidRuntime(843): FATAL EXCEPTION: main
08-30 14:25:04.049: E/AndroidRuntime(843): android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.CheckedTextView
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-30 14:25:04.049: E/AndroidRuntime(843): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.AbsListView.obtainView(AbsListView.java:1430)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ListView.makeAndAddView(ListView.java:1745)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ListView.fillDown(ListView.java:670)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ListView.fillFromTop(ListView.java:727)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.ListView.layoutChildren(ListView.java:1598)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.AbsListView.onLayout(AbsListView.java:1260)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.layout(View.java:7175)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.ViewRoot.performTraversals(ViewRoot.java:1140)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.os.Looper.loop(Looper.java:123)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-30 14:25:04.049: E/AndroidRuntime(843): at java.lang.reflect.Method.invokeNative(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843): at java.lang.reflect.Method.invoke(Method.java:507)
08-30 14:25:04.049: E/AndroidRuntime(843): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-30 14:25:04.049: E/AndroidRuntime(843): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-30 14:25:04.049: E/AndroidRuntime(843): at dalvik.system.NativeStart.main(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843): Caused by: java.lang.reflect.InvocationTargetException
08-30 14:25:04.049: E/AndroidRuntime(843): at java.lang.reflect.Constructor.constructNative(Native Method)
08-30 14:25:04.049: E/AndroidRuntime(843): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-30 14:25:04.049: E/AndroidRuntime(843): ... 42 more
08-30 14:25:04.049: E/AndroidRuntime(843): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2
08-30 14:25:04.049: E/AndroidRuntime(843): at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.view.View.<init>(View.java:1957)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.TextView.<init>(TextView.java:344)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.CheckedTextView.<init>(CheckedTextView.java:58)
08-30 14:25:04.049: E/AndroidRuntime(843): at android.widget.CheckedTextView.<init>(CheckedTextView.java:54)
08-30 14:25:04.049: E/AndroidRuntime(843): ... 45 more
i think these are the most important points:
android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.CheckedTextView
...
Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2

Change:
android:layout_height="?android:attr/listPreferredItemHeightSmall"
to:
android:layout_height="wrap_content"
This will make your list's rows expand to fit their content.

Related

Error in a simple hello world android program

I just created a simple hello world program, all codes are fine it seems, but something makes the android to show "unfortunately app needs to close" error
the startingPoint.java code which is the launcher class
package demo4;
import com.example.demo4.R;
import android.app.Activity;
import android.os.Bundle;
public class startingPoint extends Activity{
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
the main.xml which is the layout for launcher class
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</LinearLayout>
the androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demo4"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="9" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".startingPoint"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
and this is the logcat
08-30 12:46:22.921: D/AndroidRuntime(326): Shutting down VM
08-30 12:46:22.941: W/dalvikvm(326): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-30 12:46:23.021: E/AndroidRuntime(326): FATAL EXCEPTION: main
08-30 12:46:23.021: E/AndroidRuntime(326): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.demo4/com.example.demo4.startingPoint}: java.lang.ClassNotFoundException: com.example.demo4.startingPoint in loader dalvik.system.PathClassLoader[/data/app/com.example.demo4-2.apk]
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.os.Handler.dispatchMessage(Handler.java:99)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.os.Looper.loop(Looper.java:123)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-30 12:46:23.021: E/AndroidRuntime(326): at java.lang.reflect.Method.invokeNative(Native Method)
08-30 12:46:23.021: E/AndroidRuntime(326): at java.lang.reflect.Method.invoke(Method.java:507)
08-30 12:46:23.021: E/AndroidRuntime(326): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-30 12:46:23.021: E/AndroidRuntime(326): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-30 12:46:23.021: E/AndroidRuntime(326): at dalvik.system.NativeStart.main(Native Method)
08-30 12:46:23.021: E/AndroidRuntime(326): Caused by: java.lang.ClassNotFoundException: com.example.demo4.startingPoint in loader dalvik.system.PathClassLoader[/data/app/com.example.demo4-2.apk]
08-30 12:46:23.021: E/AndroidRuntime(326): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
08-30 12:46:23.021: E/AndroidRuntime(326): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
08-30 12:46:23.021: E/AndroidRuntime(326): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-30 12:46:23.021: E/AndroidRuntime(326): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
08-30 12:46:23.021: E/AndroidRuntime(326): ... 11 more
So I post my comment as an answer :)
It seems that android try to find the class in your package com.example.demo4.startingPoint, but in your code the package is just demo4. Try to change the first line by package com.example.demo4.
Resloved...it was as indicated by Mtoypc. the package name was different and it was not reflected in the startingPoint.java

How to optimize app for many API version?

I'm development app in android and use my device with API version 17 to running the app, but when I use device with API 10, the app close when start and this is the log. What mean these errors?
E/AndroidRuntime(2336): FATAL EXCEPTION: main
E/AndroidRuntime(2336): java.lang.NullPointerException
E/AndroidRuntime(2336): at org.apache.harmony.luni.util.FloatingPointParser.parseDouble(FloatingPointParser.java:263)
E/AndroidRuntime(2336): at java.lang.Double.parseDouble(Double.java:318)
E/AndroidRuntime(2336): at com.gestionderiesgos.sismosecuador.SitesAdapter.getView(SitesAdapter.java:81)
E/AndroidRuntime(2336): at android.widget.AbsListView.obtainView(AbsListView.java:1554)
E/AndroidRuntime(2336): at android.widget.ListView.makeAndAddView(ListView.java:1793)
E/AndroidRuntime(2336): at android.widget.ListView.fillDown(ListView.java:718)
E/AndroidRuntime(2336): at android.widget.ListView.fillFromTop(ListView.java:775)
E/AndroidRuntime(2336): at android.widget.ListView.layoutChildren(ListView.java:1646)
E/AndroidRuntime(2336): at android.widget.AbsListView.onLayout(AbsListView.java:1384)
E/AndroidRuntime(2336): at android.view.View.layout(View.java:7228)
E/AndroidRuntime(2336): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
E/AndroidRuntime(2336): at android.view.View.layout(View.java:7228)
E/AndroidRuntime(2336): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
E/AndroidRuntime(2336): at android.view.View.layout(View.java:7228)
E/AndroidRuntime(2336): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
E/AndroidRuntime(2336): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
E/AndroidRuntime(2336): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
E/AndroidRuntime(2336): at android.view.View.layout(View.java:7228)
E/AndroidRuntime(2336): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
E/AndroidRuntime(2336): at android.view.View.layout(View.java:7228)
E/AndroidRuntime(2336): at android.view.ViewRoot.performTraversals(ViewRoot.java:1145)
E/AndroidRuntime(2336): at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
E/AndroidRuntime(2336): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(2336): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(2336): at android.app.ActivityThread.main(ActivityThread.java:3687)
E/AndroidRuntime(2336): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(2336): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(2336): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
E/AndroidRuntime(2336): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime(2336): at dalvik.system.NativeStart.main(Native Method)
You have to setup if conditions in your code to prevent null errors by lower API versions - for example:
if (Build.VERSION.SDK_INT < 11) {
//code
} else {
//code
}

Set header to listview from layout

everybody!
I got such situation: I have a layout with some views and a listView. A question is: is it possible to take those views (from the layout where listview is situated) and set them as a header to this listview?
By now I tried:
LinearLayout header = (LinearLayout)getView().findViewById(R.id.header);
listView.addHeaderView(header, null, true);
This gives me an error:
ERROR/AndroidRuntime(18913): FATAL EXCEPTION: main
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
at android.widget.ListView.clearRecycledState(ListView.java:553)
at android.widget.ListView.resetList(ListView.java:539)
at android.widget.ListView.layoutChildren(ListView.java:1477)
at android.widget.AbsListView.onLayout(AbsListView.java:1407)
at android.view.View.layout(View.java:7314)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
at android.view.View.layout(View.java:7314)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7314)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
at android.view.View.layout(View.java:7314)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:912)
at android.view.View.layout(View.java:7314)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7314)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
at android.view.View.layout(View.java:7314)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7314)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1180)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1900)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
at dalvik.system.NativeStart.main(Native Method)

Unable to start activity android.view.InflateException

i have a created android project and within it i have created two package
--net.website.custom_listview
--main_activity_customview.java
--other files .....
--net.website.dashboard
--main_activity_dashboard.java
--other files .....
in my AndroidManifest.xml file
<activity
android:name="net.website.dashboard.main_activity_dashboard"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
so when i run the android app i am getting the following errors..
here is my logCat:
03-08 22:02:03.941: E/AndroidRuntime(691): FATAL EXCEPTION: main
03-08 22:02:03.941: E/AndroidRuntime(691): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.website/net.website.dashboard.Main_Activity_Dashboard}: android.view.InflateException: Binary XML file line #1: Error inflating class net.website.dashboard
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.os.Handler.dispatchMessage(Handler.java:99)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.os.Looper.loop(Looper.java:123)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-08 22:02:03.941: E/AndroidRuntime(691): at java.lang.reflect.Method.invokeNative(Native Method)
03-08 22:02:03.941: E/AndroidRuntime(691): at java.lang.reflect.Method.invoke(Method.java:507)
03-08 22:02:03.941: E/AndroidRuntime(691): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-08 22:02:03.941: E/AndroidRuntime(691): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-08 22:02:03.941: E/AndroidRuntime(691): at dalvik.system.NativeStart.main(Native Method)
03-08 22:02:03.941: E/AndroidRuntime(691): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class net.website.dashboard
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:684)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-08 22:02:03.941: E/AndroidRuntime(691): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.Activity.setContentView(Activity.java:1657)
03-08 22:02:03.941: E/AndroidRuntime(691): at net.website.dashboard.Main_Activity_Dashboard.onCreate(Main_Activity_Dashboard.java:16)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
03-08 22:02:03.941: E/AndroidRuntime(691): ... 11 more
03-08 22:02:03.941: E/AndroidRuntime(691): Caused by: java.lang.ClassNotFoundException: net.website.dashboard in loader dalvik.system.PathClassLoader[/data/app/net.website-2.apk]
03-08 22:02:03.941: E/AndroidRuntime(691): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-08 22:02:03.941: E/AndroidRuntime(691): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-08 22:02:03.941: E/AndroidRuntime(691): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
03-08 22:02:03.941: E/AndroidRuntime(691): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
The problem is in your layout XML file. You're referencing the class "net.website.dashboard" but it doesn't exist.
You have to change the name for your packege and then after you have to check this.and also check your xml file

Android ADB Logcat-- showing full logcat

I'm using 'adb -d logcat' in terminal to view my applications log files. Recently, I've been hitting a large block of Runtime Errors- all of which I cannot see for some reason. It just stops at the end with '...30 more' :
[ 08-11 12:27:45.500 8801:0x2261 E/AndroidRuntime ]
FATAL EXCEPTION: main
java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:347)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
at android.widget.AbsListView.obtainView(AbsListView.java:1430)
at android.widget.ListView.makeAndAddView(ListView.java:1745)
at android.widget.ListView.fillDown(ListView.java:670)
at android.widget.ListView.fillFromTop(ListView.java:727)
at android.widget.ListView.layoutChildren(ListView.java:1598)
at android.widget.AbsListView.onLayout(AbsListView.java:1260)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
at android.view.View.layout(View.java:7175)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1140)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: android.widget.FrameLayout
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:340)
... 30 more
How can I view the '... 30 more' problems that I'm receiving in the logcat??
From the question Print full call stack on printStackTrace()? :
here is an explanation of the 'caused by' and '... n more'
lines in the printed trace. see also the JavaDoc for
printStackTrace. you might not have any work to do.
Note the presence of lines containing the characters "...". These
lines indicate that the remainder of the stack trace for this
exception matches the indicated number of frames from the bottom of
the stack trace of the exception that was caused by this exception
(the "enclosing" exception). This shorthand can greatly reduce the
length of the output in the common case where a wrapped exception is
thrown from same method as the "causative exception" is caught.

Categories

Resources