Linked Questions

91 votes
2 answers
78k views

How to send HashMap value from one Intent to second Intent? Also, how to retrieve that HashMap value in the second Activity?
Piyush's user avatar
  • 3,081
53 votes
7 answers
94k views

I try to cast an object to my Action class, but it results in a warning: Type safety: Unchecked cast from Object to Action<ClientInterface> Action<ClientInterface> action = null; try { ...
Matthew's user avatar
  • 11.3k
61 votes
4 answers
81k views

I have a service defined as follows. public String getData(@QueryParam("date") Date date) I'm trying to pass a java.util.Date to it from my client (which is jaxrs:client of CXF, not a generic HTTP ...
domino's user avatar
  • 713
45 votes
3 answers
45k views

I think I get what unchecked cast means (casting from one to another of a different type), but what does it mean to "Check" the cast? How can I check the cast so that I can avoid this warning in ...
SIr Codealot's user avatar
  • 5,441
10 votes
4 answers
23k views

I am storing my JSON data into a arraylist of objects, my object class is Venue and I am passing that data into another activity using serializable from fragment but I am not receiving any values in ...
Neha Tyagi's user avatar
  • 3,821
3 votes
3 answers
5k views

My, perhaps naive, solution for cloning an ArrayList (Vector replacement) is ArrayList<Double> alBis = (ArrayList<Double>) alOriginal.clone(); considering that because the array contains ...
cibercitizen1's user avatar
3 votes
4 answers
5k views

I am trying to mock a generic interface, and whenever I mock it, I gets this warning: The expression of type GenericInterface needs unchecked conversion to conform to GenericInterface<String> My ...
Shekhar's user avatar
  • 5,961
19 votes
2 answers
3k views

Say I have a ComparatorFactory, it has many comparators composed by a lambda: public static Comparator<SomeClass> getXCmp() { return (o1, o2) -> { Double d1 = Double....
Tony's user avatar
  • 6,208
5 votes
3 answers
2k views

I'm trying to use one of the simplest forms of reflection to create an instance of class: package some.common.prefix; public interface My { void configure(...); void process(...); } public ...
GreyCat's user avatar
  • 17.2k
1 vote
1 answer
14k views

I have a hashmap defined like this that I cant change private Map<String, Object> attributes; The object is a list of Strings (sometimes size == 1, other times > 1). I have an instance of ...
user3861559's user avatar
  • 1,013
1 vote
2 answers
5k views

I want to send the arraylist with hashmap between activities but is give me null arraylist with hashmap. Sender Activity ArrayList<HashMap<String,String>> childgame = new ArrayList<...
start android's user avatar
0 votes
2 answers
8k views

I am creating a stack of generic type that is backed by an array. When I try to make a generic type array, Java does not let me. I've been told that I must create an array of type Object and cast it ...
ChrisAngj's user avatar
  • 305
4 votes
3 answers
1k views

I am wondering why the following issues a warning about an unsafe / unchecked operation: Map<String, ProxySession> sessionMap = (Map<String, ProxySession>) se.getSession()....
gpol's user avatar
  • 966
1 vote
1 answer
4k views

Casting, instanceof, and @SuppressWarnings("unchecked") are noisy. It would be nice to stuff them down into a method where they won't need to be looked at. CheckedCast.castToMapOf() is an attempt to ...
candied_orange's user avatar
2 votes
1 answer
5k views

I'm getting odd warnings in my reading of a ArrayList of Serializable objects. Here is the code: public void loadBoard() { FileInputStream fis = null; ObjectInputStream is; try { ...
Alan Moore's user avatar
  • 6,575

15 30 50 per page