Office Hours — Today, November 26

Tuesday, November 20

Nov 26
3:55 PM
Mark M.
has entered the room
Mark M.
turned on guest access
4:40 PM
Gabriele
has entered the room
Gabriele
Hi
Mark M.
howdy, Gabriele!
how can I help you today?
Gabriele
My terrible connection :(
Do you still have the github project?
Mark M.
yes
4:45 PM
Gabriele
I think i'm doing something bad with fragments because when i receive the intent from the browser i get null exception from isconnected method inside wikifragment class
Mark M.
"when i receive the intent from the browser"?
do you mean a separate Web browser app?
Gabriele
Yes the default one
Mark M.
oh, via the *.wikipedia.org <intent-filter>
OK
Gabriele
Maybe my instantiation is bad or something like this hm and when changhing fragment i have getactivity null
Yes
Mark M.
presumably, you are getting the NullPointerException on the first line of isConnected()
and that because getActivity() is null
if so, that means you are calling loadUrl() too early
I ran into that with EU4You
which is why my DetailsActivity caches the URL and hands it over to the fragment in onPause(), IIRC
Gabriele
This is what i thought so i moved it after onactivitycreated
Mark M.
getActivity() should return non-null in onActivityCreated()
Gabriele
Is it wrong? Im getting null
Mark M.
which activity or activities can host WikiFragment?
4:50 PM
Gabriele
I have only wikiapp
Mark M.
hold on, let me look at it
well, you call onCreatedView() from the fragment in onCreateView()
onCreatedView() calls goTo()
goTo() calls loadUrl()
Gabriele
Yes that before my last update when i moved it to oncreatedactivity
I could not update it becuase of my dead connection TT
Mark M.
I don't know what to tell you
4:55 PM
Mark M.
put a breakpoint on the line that crashes and confirm that the call tree is what you think it is
Gabriele
Under mypageradapter
The fragment instantiation is correct?
Mark M.
it's not obviously wrong
Gabriele
Do i need the two get methods? Or i should use getactivity always?
Mark M.
what "two get methods"?
Gabriele
Getwikifragment and getbookmarkfragment
Mark M.
there is nothing wrong with what you have that I see
Gabriele
I' using them to access fragments from the mainactivity
Mark M.
again, there is nothing obviously wrong with your approach
Gabriele
Can happen that i'm referring to the bad one in this case? Like old fragment ect.
Hm
Mark M.
only if you are only encountering this problem on a configuration change or something
wait
what is the *precise* set of steps that is causing your crash?
5:00 PM
Gabriele
I open the browser, open a wiki page, choose my app and then it crashes
5:00 PM
Mark M.
does it happen when you start from the home screen launcher?
Gabriele
Yes
Mark M.
OK, so it always happens?
Gabriele
Yes
Mark M.
then it cannot be tied to a configuration change, as you are not always doing a configuration change
Gabriele
Ah
Mark M.
and, that's the end of today's chat
Gabriele
I will investigate better if my connecion comes back, for the next time
Mark M.
the next one is tomorrow at 10am Eastern
Gabriele
Thank you very much
Mark M.
have a pleasant day!
Gabriele
See you, good bye
Gabriele
has left the room
Mark M.
turned off guest access

Tuesday, November 20

 

Office Hours

People in this transcript

  • Gabriele
  • Mark Murphy