android - Use of nullable in onCreateView and onCreatedView -


i have 2 fragments classes , b , 1 mainactivity class.i looked tutorials , have added recycler view(this not main concern though).following tutorial on both fragment classes have code

@nullable @override public view oncreateview (layoutinflater inflater, @nullable      viewgroup container, @nullable bundle savedinstancestate){     view rootview = inflater.inflate(r.layout.absent, container, false);     return rootview;   }  @override public void onviewcreated(view view, @nullable bundle savedinstancestate) {     super.onviewcreated(view, savedinstancestate);   } 

so use of @nullablehere?.i have searched many times can't understand it's use , tutorial haven't mentioned @nullabe.can make me understand this? please don't bother in talking recycler view because have added it.

the @nullable annotation indicates variable, parameter, or return value can null ever "nullpointerexception"? that's because value null.

integer x;  

'x' null because haven't assigned value there errors using it. if have variable might null in use cases? well, you'd use @nullable annotation meaning it's okay null.

@nullable bundle savedinstancestate 

bundle in case might have nothing stored in it. it's okay null when method called.

same goes method oncreateview() meaning return can null


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -