Linked Questions

0 votes
1 answer
53 views

i'm working with fragments. I have created a List fragment and a Detail fragment. when i click on an item in the list the app crashes and it gives the following null pointer exception. Attempt to ...
Usama Ali's user avatar
0 votes
0 answers
46 views

my application so far is like this: in ActivityHome, it opens the Fragments using a "FragmentContainerView", my FragmentHome loads the firebase videos in a ViewPage2, using the design of an ...
Ronaldo's user avatar
  • 11
1 vote
0 answers
45 views

As you know, in a lot of cases we need to check if an object is null or not to execute a method. It`s really not good to code, it gets ugly and repetitive. And sometimes the null objects was excepted (...
Rodrigo Farias Rezino's user avatar
-3 votes
1 answer
44 views

Edit: I found the solution, for some reason the code does not run android studio if it is linked to the GitHub repository. I pushed the same version to a new branch on GitHub and downloaded the code ...
Mateus Jorge's user avatar
0 votes
0 answers
37 views

I am very new at writing tests and I am trying to write a simple one to check that the email the user writes for the login is valid. I got the way to do it from a tutorial and it makes sense the way ...
dazai's user avatar
  • 726
0 votes
0 answers
35 views

Just as the title says. I dont think my adapter and view holder are wrong (but then again its my first time using it), but upon launching the programme, my emulator crashes. Is it something to do with ...
Kelven Lim's user avatar
0 votes
0 answers
25 views

I have a problem and I hope anyone can help me When I give the button id and go to Main Activity to use the button with the set On Click Listener feature, an error occurs Kotlin language
Ahmad Al Halabi's user avatar
209 votes
12 answers
4.3m views

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program ...
756 votes
5 answers
253k views

Why is Java Vector considered a legacy class, obsolete or deprecated? Isn't its use valid when working with concurrency? And if I don't want to manually synchronize objects and just want to use a ...
fjsj's user avatar
  • 11.3k
373 votes
14 answers
188k views

Having been using Java 8 now for 6+ months or so, I'm pretty happy with the new API changes. One area I'm still not confident in is when to use Optional. I seem to swing between wanting to use it ...
Will's user avatar
  • 6,751
392 votes
7 answers
121k views

Optional type introduced in Java 8 is a new thing for many developers. Is a getter method returning Optional<Foo> type in place of the classic Foo a good practice? Assume that the value can be ...
leonprou's user avatar
  • 4,948
205 votes
17 answers
87k views

There's a discussion going on over at comp.lang.c++.moderated about whether or not assertions, which in C++ only exist in debug builds by default, should be kept in production code or not. Obviously, ...
122 votes
16 answers
217k views

I was reading an InfoWorld article (link to Wayback machine since the excerpt was since removed), and came across this little tidbit: Take the latest version of Java, which tries to make null-pointer ...
Erty Seidohl's user avatar
  • 4,589
62 votes
19 answers
115k views

When there is a post-condition, that return value of a method must not be null, what can be done? I could do assert returnValue != null : "Not acceptable null value"; but assertions could be turned ...
stratwine's user avatar
  • 3,699
103 votes
11 answers
58k views

Let's say I'd like to perform the following command: house.getFloor(0).getWall(WEST).getDoor().getDoorknob(); To avoid a NullPointerException, I'd have to do the following if: if (house != null &...
user avatar

15 30 50 per page
1 2
3
4 5
12