abstract method not implemented in RecyclerView Adapter - android

I added some feature to an existing running project and I tested the Application full testing after that to find out that any RecyclerView crashes after add/removing items from it ( after notifying the adapter with the changes ).
I am using notifyDataSetChanged() and I tried to use notifyItemRemoved() and notifyItemInserted() but the problem still happening.
My gradle file :
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
.......
.......
The Logs :
08-29 09:48:21.874: W/dalvikvm(4290): threadid=1: thread exiting with uncaught exception (group=0xb2d29b20)
08-29 09:48:21.874: W/System.err(4290): java.lang.AbstractMethodError: abstract method not implemented
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView$ItemAnimator.animateDisappearance(RecyclerView.java)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView.animateDisappearance(RecyclerView.java:3252)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView.access$700(RecyclerView.java:147)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView$4.processDisappeared(RecyclerView.java:431)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.java:246)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3098)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2917)
08-29 09:48:21.884: W/System.err(4290): at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3283)
08-29 09:48:21.884: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.884: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.884: W/System.err(4290): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
08-29 09:48:21.884: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.884: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.884: W/System.err(4290): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
08-29 09:48:21.884: W/System.err(4290): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
08-29 09:48:21.884: W/System.err(4290): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
08-29 09:48:21.884: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.884: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.884: W/System.err(4290): at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:122)
08-29 09:48:21.884: W/System.err(4290): at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
08-29 09:48:21.884: W/System.err(4290): at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1170)
08-29 09:48:21.894: W/System.err(4290): at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:814)
08-29 09:48:21.894: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.894: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.894: W/System.err(4290): at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1191)
08-29 09:48:21.894: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.894: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.894: W/System.err(4290): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
08-29 09:48:21.894: W/System.err(4290): at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
08-29 09:48:21.894: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.894: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.894: W/System.err(4290): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
08-29 09:48:21.894: W/System.err(4290): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
08-29 09:48:21.894: W/System.err(4290): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
08-29 09:48:21.894: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.894: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.894: W/System.err(4290): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
08-29 09:48:21.894: W/System.err(4290): at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
08-29 09:48:21.904: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.904: W/System.err(4290): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
08-29 09:48:21.904: W/System.err(4290): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
08-29 09:48:21.904: W/System.err(4290): at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
08-29 09:48:21.904: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.904: W/System.err(4290): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
08-29 09:48:21.904: W/System.err(4290): at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
08-29 09:48:21.904: W/System.err(4290): at android.view.View.layout(View.java:14817)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewGroup.layout(ViewGroup.java:4631)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1987)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1744)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
08-29 09:48:21.904: W/System.err(4290): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
08-29 09:48:21.904: W/System.err(4290): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
08-29 09:48:21.904: W/System.err(4290): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
08-29 09:48:21.904: W/System.err(4290): at android.view.Choreographer.doFrame(Choreographer.java:544)
08-29 09:48:21.904: W/System.err(4290): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
08-29 09:48:21.904: W/System.err(4290): at android.os.Handler.handleCallback(Handler.java:733)
08-29 09:48:21.904: W/System.err(4290): at android.os.Handler.dispatchMessage(Handler.java:95)
08-29 09:48:21.904: W/System.err(4290): at android.os.Looper.loop(Looper.java:136)
08-29 09:48:21.904: W/System.err(4290): at android.app.ActivityThread.main(ActivityThread.java:5017)
08-29 09:48:21.904: W/System.err(4290): at java.lang.reflect.Method.invokeNative(Native Method)
08-29 09:48:21.904: W/System.err(4290): at java.lang.reflect.Method.invoke(Method.java:515)
08-29 09:48:21.904: W/System.err(4290): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-29 09:48:21.904: W/System.err(4290): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-29 09:48:21.904: W/System.err(4290): at dalvik.system.NativeStart.main(Native Method)

AbstractMethodError is a dual exception (has both cases of being caught at compile time and cases of being caught at runtime) . And Java docs for this class states "Thrown when an application tries to call an abstract method.".
Abstract methods are function without implementation i.e. they only have defined function signature (a.k.a. header) . So when JVM jumps to an abstract method's entry point, it throws this exception since it doesn't know what to do (function definition is still empty) . So you need to override all abstract functions defined in the class you're extending with actual functions that have implementation. In your case in particular, RecyclerView calls abstract function animateDissapearance when removing an item from its adapter's collection, and it also calls abstract function animateAppearance when adding an item to its adapter's collection. You don't seem to be overriding these functions in your RecyclerView class.
The fix to your exception ends with the previous paragraph. This is just in case you're wondering why would anyone use abstract methods when they don't do anything and even cause exceptions.
Abstract methods (mostly used in libraries and other developer tools) allow the developer to reference, schedule and work with arbitrarily complex unit of work without worrying about its actual implementation. This is especially useful when you're developing libraries since you don't know the cases your users are going to use. I'll give an example that people can, hopefully, easily identify with:
Imagine you are developing a tool that want to support plugins developed by independent developers. To have an even clearer example - let it be an email client. Now, we'll take a look at one situation when your email client should send the email. And suppose you're expecting dev community to develop plugins that backup email copies to hard drive, to cloud storage or any other action that is related to the mail, prior to the sending. You don't and can't know what they are up to, but you know what they need as input and expect at output. So you implement your mail-sending function like this:
boolean sendMail(HashMap<String, String> headers, String body, String recipient, List<DeveloperPlugin> activePlugins) {
//Your parameter validation
for(DeveloperPlugin plugin : activePlugins) {
plugin.runBeforeSendEmailAction(headers, body);
}
//Send email
}
Then you instruct your developer community to store all their logic in a class that extends DeveloperPlugin class (or implements DeveloperPlugin interface) and specifically implement all their actions related to mail that they want to execute before the mail is actually sent, inside the runBeforeSendEmailAction(HashMap<String, String> headers, String body) function of that class (interface) . This solves the biggest problem you face as main module developer - how to ensure application behaves the same no matter what plugin developers implement. It also solves the biggest problem plugin developers face - how do I know what input will my function get and how and when do I call it?
I considerably went overboard with this, but hopefully someone will find it interesting, maybe even helpful.
Cheers! :D

I fixed it by downgrade the android support libraries to 23.1.1 and disabling the change animations :
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
And in the activity class :
//Added the following line just for case
recyclerView.setHasFixedSize(false);
//REMOVE the following line
recyclerView.setItemAnimator(animator);
In the XML add the following line to the RecycleView tag :
android:animateLayoutChanges="false"
And eveything is working fine with me now.

Related

Crashlytics reporting multiples issues for TextView.makeSingleLayout

I am receiving multiples crash reports about the same error, but I have no idea what is may causing it.
The exception that is throwing is ArrayIndexOutOfBoundsException in android.widget.TextView.makeSingleLayout.
I know it is not about Android versions and devices types, since it is getting reports from multiple versions and devices.
Here is what I am getting from Crashlytics:
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=125; index=-1
at android.text.StaticLayout.calculateEllipsis(StaticLayout.java:785)
at android.text.StaticLayout.out(StaticLayout.java:704)
at android.text.StaticLayout.generate(StaticLayout.java:410)
at android.text.StaticLayout.<init>(StaticLayout.java:140)
at android.widget.TextView.makeSingleLayout(TextView.java:6199)
at android.widget.TextView.makeNewLayout(TextView.java:6056)
at android.widget.TextView.onMeasure(TextView.java:6432)
at android.view.View.measure(View.java:16653)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1231)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
at android.view.View.measure(View.java:16653)
at android.widget.ListView.setupChild(ListView.java:1870)
at android.widget.ListView.makeAndAddView(ListView.java:1793)
at android.widget.ListView.fillDown(ListView.java:691)
at android.widget.ListView.fillFromTop(ListView.java:752)
at android.widget.ListView.layoutChildren(ListView.java:1616)
at android.widget.AbsListView.onLayout(AbsListView.java:2087)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:636)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1167)
at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:852)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:871)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14973)
at android.view.ViewGroup.layout(ViewGroup.java:4637)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1995)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1752)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1008)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5717)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5127)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(NativeStart.java)
Is there any solution for that?
I do not write a explicit implementation for TextView.makeSingleLayout.
It has been almost a year, so my memory on this is a little fuzzy, but...
I faced what I suspect is the same problem in my own app. For me, it was happening because I was using android:ellipsize="start" without also using android:singleLine="true".
We had switched all of our android:singleLine="true" attributes to the recommended android:maxLines="1", but it turns out that there's a bug in how the system calculates the ellipsis that is triggered if singleLine isn't present.
So I believe you can solve this issue by simply adding android:singleLine="true" to your TextViews that are using ellipsize attrs.

java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 and some time my appcrash and some time work properly [duplicate]

This question already has answers here:
What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?
(26 answers)
Closed 5 years ago.
Error:
03-28 14:23:08.466 8743-8743/com.furbonics.furbonicsexecutive
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.furbonics.furbonicsexecutive, PID: 8743
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at
java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
at
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:390)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
at android.widget.Spinner.makeView(Spinner.java:592)
at android.widget.Spinner.layout(Spinner.java:540)
at android.widget.Spinner.onLayout(Spinner.java:502)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at
android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1660)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1436)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.widget.ScrollView.onLayout(ScrollView.java:1468)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14845)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2026)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1783)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1039)
at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5648)
at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.o
You are trying to read a value from an empty array
lang.IndexOutOfBoundsException: Invalid index 0, size is 0.
Verify that the array is not empty before accessing a value in your code.
It means you are not able to fetch data. First use log and check if output is shown if no then check your code also surround your code for fetching with try and catch.

Android Studio: Unfortunately app has stopped

When i try to run my app, "Unfortunately, “app” has Stopped" pop on the screen. I have researched this problem and tried of changing code in manifest file. Also I tried many times cleaning project, rebuilding project, Invalidate Cache and restart option but this also doesn't help in solving problem.
Here is the error shown in my logcat
02-21 09:26:52.695 3123-3123/? E/memtrack: Couldn't load memtrack module (No such file or directory)
02-21 09:26:52.695 3123-3123/? E/android.os.Debug: failed to load memtrack module: -2
02-21 09:26:56.587 3137-3137/? E/memtrack: Couldn't load memtrack module (No such file or directory)
02-21 09:26:56.587 3137-3137/? E/android.os.Debug: failed to load memtrack module: -2
02-21 09:26:57.611 3147-3147/com.example.nobelz.chatapp E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
02-21 09:26:58.231 3147-3147/com.example.nobelz.chatapp E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
02-21 09:26:58.235 3147-3147/com.example.nobelz.chatapp E/OpenGLRenderer: MAX_TEXTURE_SIZE: 8192
02-21 09:26:58.259 3147-3147/com.example.nobelz.chatapp E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
02-21 09:26:58.263 3147-3147/com.example.nobelz.chatapp E/OpenGLRenderer: MAX_TEXTURE_SIZE: 8192
02-21 09:27:02.323 3147-3147/com.example.nobelz.chatapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.nobelz.chatapp, PID: 3147
com.google.firebase.database.DatabaseException: Class com.example.nobelz.chatapp.ChatMessage is missing a constructor with no arguments
at com.google.android.gms.internal.zzbqi$zza.zze(Unknown Source)
at com.google.android.gms.internal.zzbqi$zza.zzaG(Unknown Source)
at com.google.android.gms.internal.zzbqi.zze(Unknown Source)
at com.google.android.gms.internal.zzbqi.zzb(Unknown Source)
at com.google.android.gms.internal.zzbqi.zza(Unknown Source)
at com.google.firebase.database.DataSnapshot.getValue(Unknown Source)
at com.firebase.ui.database.FirebaseListAdapter.parseSnapshot(FirebaseListAdapter.java:127)
at com.firebase.ui.database.FirebaseListAdapter.getItem(FirebaseListAdapter.java:116)
at com.firebase.ui.database.FirebaseListAdapter.getView(FirebaseListAdapter.java:146)
at android.widget.AbsListView.obtainView(AbsListView.java:2255)
at android.widget.ListView.makeAndAddView(ListView.java:1790)
at android.widget.ListView.fillDown(ListView.java:691)
at android.widget.ListView.fillFromTop(ListView.java:752)
at android.widget.ListView.layoutChildren(ListView.java:1616)
at android.widget.AbsListView.onLayout(AbsListView.java:2087)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1983)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1740)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:996)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5600)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
at android.view.Choreographer.doCallbacks(Choreographer.java:574)
at android.view.Choreographer.doFrame(Choreographer.java:544)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
02-21 09:27:07.367 560-593/system_process E/InputDispatcher: channel '52c1f3d8 com.example.nobelz.chatapp/com.example.nobelz.chatapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
02-21 09:31:38.407 232-232/? E/Drm: Failed to open plugin directory /vendor/lib/mediadrm
02-21 09:32:05.543 859-1264/com.google.process.gapps E/dalvikvm: Could not find class 'android.net.Network', referenced from method qlb.a
02-21 09:34:38.537 859-1421/com.google.process.gapps E/NetworkScheduler: Called closeAndCleanupTask for already completed task [com.google.android.apps.maps/com.google.android.apps.gmm.offline.OfflineAutoUpdateGcmService:OfflineAutoUpdateGcmService.TASK_TAG,u0]' :TIMED_OUT
02-21 09:34:38.573 859-1421/com.google.process.gapps E/NetworkScheduler: Task completed but with no record in list of active tasks: [com.google.android.apps.maps/com.google.android.apps.gmm.offline.OfflineAutoUpdateGcmService:OfflineAutoUpdateGcmService.TASK_TAG,u0]
02-21 09:34:40.793 3391-3391/? E/dalvikvm: Could not find class 'javax.net.ssl.SNIHostName', referenced from method com.google.android.gms.org.conscrypt.Platform.getSSLParameters
02-21 09:34:40.797 3391-3391/? E/dalvikvm: Could not find class 'javax.net.ssl.SNIServerName', referenced from method com.google.android.gms.org.conscrypt.Platform.setSSLParameters
02-21 09:34:40.805 3391-3391/? E/dalvikvm: Could not find class 'com.google.android.gms.org.conscrypt.OpenSSLExtendedSessionImpl', referenced from method com.google.android.gms.org.conscrypt.Platform.wrapSSLSession
02-21 09:34:40.833 725-725/com.google.android.gms.persistent E/ChimeraRcvrProxy: Chimera config error: com.google.android.chimera.config.InvalidConfigException: No registered Chimera receiver impl for ComponentInfo{com.google.android.gms/com.google.android.gms.phenotype.receiver.PhenotypeBroadcastReceiver}
02-21 09:34:40.833 725-725/com.google.android.gms.persistent E/ChimeraRcvrProxy: com.google.android.gms.phenotype.receiver.PhenotypeBroadcastReceiver dropping broadcast com.google.android.gms.phenotype.UPDATE
02-21 09:34:40.913 3391-3391/? E/dalvikvm: Could not find class 'com.google.android.gms.org.conscrypt.OpenSSLExtendedSessionImpl', referenced from method com.google.android.gms.org.conscrypt.SSLParametersImpl.getSessionToReuse
02-21 09:34:41.169 725-725/com.google.android.gms.persistent E/BluetoothAdapter: Bluetooth binder is null
02-21 09:34:41.645 725-725/com.google.android.gms.persistent E/BluetoothAdapter: Bluetooth binder is null
02-21 09:34:41.709 725-3425/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback
02-21 09:34:41.937 725-725/com.google.android.gms.persistent E/BluetoothAdapter: Bluetooth binder is null
02-21 09:34:42.013 725-1235/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback
02-21 09:34:42.069 725-725/com.google.android.gms.persistent E/BluetoothAdapter: Bluetooth binder is null
02-21 09:34:42.161 725-1235/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback
02-21 09:34:42.265 725-1235/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback
02-21 09:34:42.309 725-1235/com.google.android.gms.persistent E/GCoreUlr: Bad errorId configuring silent feedback
02-21 09:35:10.173 560-567/system_process E/dalvikvm: JIT code cache full
In class ChatMessage add constructor without parameters:
public ChatMessage () {
//Do things
}
The part with the builder is surely the most important: it seems you're missing it:
com.google.firebase.database.DatabaseException: Class com.example.nobelz.chatapp.ChatMessage is missing a constructor with no arguments
I suggest you to rewrite your code adding a feature at a time, so that you can isolate your problem and solve it.

Reusing AndroidTV RowsFragment outside BrowseFragment

I'm trying to reuse the RowsFragment provided by AndroidTV Leanback outside of a BrowseFragment, to have a similar row interaction look & feel on a different layout, but I'm getting XML-inflation errors that I haven't been able to debug and solve.
The implementation itself is similar to what is implemented here: https://medium.com/building-for-android-tv , but in the blog he's replacing different fragments of the same kind inside a BrowseFragment. Is there something fundamentally wrong with my approach? If so, why? I've been reading through the Leanback sources and haven't been able to find anything that I would understand (although it's a large library) that would couple the fragments to that degree.
A reproduction of the relevant code:
https://gist.github.com/orbitbot/c9070ed00961c3abe4ca
02-26 12:12:26.950 4465-4527/com.my.client E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.my.client, PID: 4465
android.view.InflateException: Binary XML file line #18: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:462)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v17.leanback.widget.RowContainerView.<init>(RowContainerView.java:48)
at android.support.v17.leanback.widget.RowContainerView.<init>(RowContainerView.java:37)
at android.support.v17.leanback.widget.RowPresenter.onCreateViewHolder(RowPresenter.java:169)
at android.support.v17.leanback.widget.ItemBridgeAdapter.onCreateViewHolder(ItemBridgeAdapter.java:247)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:4121)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3431)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3340)
at android.support.v17.leanback.widget.GridLayoutManager.getViewForPosition(GridLayoutManager.java:573)
at android.support.v17.leanback.widget.GridLayoutManager$2.createItem(GridLayoutManager.java:1057)
at android.support.v17.leanback.widget.StaggeredGrid.appendItemToRow(StaggeredGrid.java:242)
at android.support.v17.leanback.widget.StaggeredGridDefault.appendItems(StaggeredGridDefault.java:49)
at android.support.v17.leanback.widget.GridLayoutManager.appendOneVisibleItem(GridLayoutManager.java:1263)
at android.support.v17.leanback.widget.GridLayoutManager.appendVisibleItems(GridLayoutManager.java:1273)
at android.support.v17.leanback.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:1554)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:1988)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2237)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.support.v17.leanback.widget.ScaleFrameLayout.onLayout(ScaleFrameLayout.java:135)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1989)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1746)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5672)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:772
Make sure that your ChangePicActivity has proper theme in AndroidManifest.xml
Add android:theme="#style/Theme.Leanback" to relevant activity tag.
Like this
<activity
android:name=".ChangePicActivity"
android:theme="#style/Theme.Leanback"
>
[...]

code run on ginger bread but not working on Jelly Bean?

I am doing DOM xml parsing,My code is working perfectly on Ginger bread while not working on Jelly Bean. showing NullPointerException . on below line got error.
NodeList n1= doc.getElementsByTagName("dua_detail");
I took xml File from assets folder perfectly on AsyncTask.
08-29 18:01:23.785: E/AndroidRuntime(3575): java.lang.NullPointerException
08-29 18:01:23.785: E/AndroidRuntime(3575): at com.example.zad_e_rah.Finalview.pinpointxml(Finalview.java:67)
08-29 18:01:23.785: E/AndroidRuntime(3575): at com.example.zad_e_rah.Finalview$GetAudiojokefromserver.onPostExecute(Finalview.java:333)
08-29 18:01:23.785: E/AndroidRuntime(3575): at com.example.zad_e_rah.Finalview$GetAudiojokefromserver.onPostExecute(Finalview.java:1)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.os.AsyncTask.finish(AsyncTask.java:631)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.os.AsyncTask.access$600(AsyncTask.java:177)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.os.Looper.loop(Looper.java:153)
08-29 18:01:23.785: E/AndroidRuntime(3575): at android.app.ActivityThread.main(ActivityThread.java:5086)
08-29 18:01:23.785: E/AndroidRuntime(3575): at java.lang.reflect.Method.invokeNative(Native Method)
08-29 18:01:23.785: E/AndroidRuntime(3575): at java.lang.reflect.Method.invoke(Method.java:511)
08-29 18:01:23.785: E/AndroidRuntime(3575): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
If the above line is really the line that throws the exception, the doc-object is probably null. You should check that.
Since you didn't provide more code I cannot tell you why it is null.

Categories

Resources