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)
Related
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
}
I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
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:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}
I am using DrawerNavigator in my app.
I created an android app which works perfectly with android 4.2 but when I try to launch it in android 2.2 I get this error:
android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:332)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
at android.widget.AbsListView.obtainView(AbsListView.java:1582)
at android.widget.ListView.makeAndAddView(ListView.java:1801)
at android.widget.ListView.fillDown(ListView.java:724)
at android.widget.ListView.fillFromTop(ListView.java:781)
at android.widget.ListView.layoutChildren(ListView.java:1638)
at android.widget.AbsListView.onLayout(AbsListView.java:1412)
at android.view.View.layout(View.java:7175)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:672)
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:1146)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1866)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
EDIT: these lines are also in there:
07-22 16:00:52.111: E/AndroidRuntime(470): Caused by: android.content.res.Resources$NotFoundException: File res/color/abs__primary_text_holo_light.xml from xml type drawable resource ID #0x0
07-22 16:00:52.111: E/AndroidRuntime(470): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1924)
07-22 16:00:52.111: E/AndroidRuntime(470): at android.content.res.Resources.loadDrawable(Resources.java:1692)
07-22 16:00:52.111: E/AndroidRuntime(470): ... 42 more
I cant figure out why.
I am calling my fragment (ShelrockFragment) from MainActivity :
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.content_frame, newsMasterFragment, "MasterFragment");
bundle.putBoolean("onFirstRow", true);
newsMasterFragment.setArguments(bundle);
and it crashes when inflating the view:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_news_master,
container, false);
In case anybody has the same problem the issue was the android:background
android:background="?android:attr/activatedBackgroundIndicator"
crushed the whole app. So I removed it in the pre-Honeycomb versions
It's because Fragments API was introduced in Android 3.0 (API level 11).
If you want to use them in Android 2.2 (API level 8), you have to use compatibility libraries provided by Google. How to do it, you can read for example here: Fragments in Android 2.2.1, 2.3, 2.0. Is this possible?
In drawer_list_item.xml file
remove android:background="?android:attr/activatedBackgroundIndicator" line
if you want background change with html color code.
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.
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.