classcastexception

How to retrieve 'double' values saved under one key in Firebase?

故事扮演 提交于 2019-12-30 14:36:30
问题 I have stored Geofire coordinates in database and now I'm trying to retrieve them using childEventListener() like this: mDatabase.child("geofire").child(key).child("l").addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { if (dataSnapshot.getValue() != null) { //error on line below Map<Double, Double> newRequest = (Map<Double, Double>) dataSnapshot.getValue(); venueLatString = newRequest.get(0).toString(); venueLngString =

Primefaces datatable date range filter with filterFunction

≯℡__Kan透↙ 提交于 2019-12-28 11:57:47
问题 I use filterFunction method of datatable on primefaces 5.0. I want to filter birthday by date range on column header. On browser console I receive this error: <?xml version="1.0" encoding="utf-8"?><partial-response><error><error-name>java.lang.ClassCastException</error-name><error-message><![CDATA[javax.faces.component.UIPanel cannot be cast to javax.faces.component.ValueHolder]]></error-message></error></partial-response> Datatable : <p:dataTable var="person" value="#{testDateRange.persons}"

Android: ClassCastException when adding a header view to ExpandableListView

↘锁芯ラ 提交于 2019-12-28 05:16:12
问题 I'm trying to add a header to an ExpandableListView like so: headerView = View.inflate(this, R.layout.header, null); expandableListView.addHeaderView(headerView); expandableListView.setAdapter(new SectionedAdapter(this)); Which gives me the following error: 12-08 16:23:42.354: ERROR/AndroidRuntime(421): Caused by:java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams 12-08 16:23:42.354: ERROR/AndroidRuntime(421): at android.widget.ListView.clearRecycledState(ListView.java:504)

android.app.Application cannot be cast to android.app.Activity

浪尽此生 提交于 2019-12-27 22:07:26
问题 I'm trying to change a LinearLayout from another class, but when i run this code: public class IRC extends PircBot { ArrayList<String> channels; ArrayList<Integer> userCount; ArrayList<String> topics; LinearLayout channelLayout; Context context; public IRC(Context ctx) { this.setName("xxxx"); channels = new ArrayList<String>(); userCount = new ArrayList<Integer>(); topics = new ArrayList<String>(); context = ctx; channelLayout = (LinearLayout) ((Activity) context).findViewById(R.id.channels);

android.app.Application cannot be cast to android.app.Activity

天大地大妈咪最大 提交于 2019-12-27 22:06:10
问题 I'm trying to change a LinearLayout from another class, but when i run this code: public class IRC extends PircBot { ArrayList<String> channels; ArrayList<Integer> userCount; ArrayList<String> topics; LinearLayout channelLayout; Context context; public IRC(Context ctx) { this.setName("xxxx"); channels = new ArrayList<String>(); userCount = new ArrayList<Integer>(); topics = new ArrayList<String>(); context = ctx; channelLayout = (LinearLayout) ((Activity) context).findViewById(R.id.channels);

android.widget.FrameLayout cannot be cast to com.example.crowderia.chat.view.SnapTabView?

浪子不回头ぞ 提交于 2019-12-25 12:15:10
问题 I have a frame layout call view_snap_tabs.xml that have image and view like below <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="184dp" xmlns:tools="http://schemas.android.com/tools" tools:layout_gravity="bottom" tools:background="@color/light_purple"> <ImageView android:id="@+id/vst_bottom_image" android:layout_width="32dp" android:layout_height="32dp" android:layout

android.widget.FrameLayout cannot be cast to com.example.crowderia.chat.view.SnapTabView?

限于喜欢 提交于 2019-12-25 12:14:49
问题 I have a frame layout call view_snap_tabs.xml that have image and view like below <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="184dp" xmlns:tools="http://schemas.android.com/tools" tools:layout_gravity="bottom" tools:background="@color/light_purple"> <ImageView android:id="@+id/vst_bottom_image" android:layout_width="32dp" android:layout_height="32dp" android:layout

java.lang.ClassCastException: Creating a synchronized Linked List

半腔热情 提交于 2019-12-24 13:00:21
问题 I want a synchronized LinkedList with a Generic Class A, here the relevant parts: public abstract class A<T extends B> implements Runnable { And the interface for B, where the "real" B, will be a supclass public interface B{ Following setup will throw a runtime error: LinkedList<A<? extends B>> eopList = (LinkedList<A<? extends B>>) Collections .synchronizedCollection(new LinkedList<A<? extends B>>()); I've found the following proposal, but it also won't compile: LinkedList<A<? extends B>>

Unity3d share image on android

本秂侑毒 提交于 2019-12-24 08:36:03
问题 Trying to implement android image sharing on a Unity game, I've put together several sources, this is my current code.- public static void shareImage(string subject, string title, string message, string imagePath) { #if UNITY_ANDROID AndroidJavaClass intentClass = new AndroidJavaClass("android.content.Intent"); AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent"); intentObject.Call<AndroidJavaObject>("setAction", intentClass.GetStatic<string>("ACTION_SEND"));

Caugth ClassCastException in my Java application

淺唱寂寞╮ 提交于 2019-12-23 19:40:35
问题 A queue implementaion using an array but i m getting an exception. I have an interface named as Queue with generic ArrayQueue as implemented class of Queue Interface ArrayQueueTest as my main class to test the code. public interface Queue<E> { public void enqueue(E e);//insert an element in a queue public E dequeue();/delete an element in queue and return that element public int size();//give the number of elements in an queue public E first();//give the first element of queue if any but not