Nov 26 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Nov 26 | 4:40 PM |
Gabriele | has entered the room |
Gabriele |
Hi
|
Mark M. |
howdy, Gabriele!
|
Mark M. |
how can I help you today?
|
Gabriele |
My terrible connection :(
|
Gabriele |
Do you still have the github project?
|
Mark M. |
yes
|
Nov 26 | 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"?
|
Mark M. |
do you mean a separate Web browser app?
|
Gabriele |
Yes the default one
|
Mark M. |
oh, via the *.wikipedia.org <intent-filter>
|
Mark M. |
OK
|
Gabriele |
Maybe my instantiation is bad or something like this hm and when changhing fragment i have getactivity null
|
Gabriele |
Yes
|
Mark M. |
presumably, you are getting the NullPointerException on the first line of isConnected()
|
Mark M. |
and that because getActivity() is null
|
Mark M. |
if so, that means you are calling loadUrl() too early
|
Mark M. |
I ran into that with EU4You
|
Mark M. |
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?
|
Nov 26 | 4:50 PM |
Gabriele |
I have only wikiapp
|
Mark M. |
hold on, let me look at it
|
Mark M. |
well, you call onCreatedView() from the fragment in onCreateView()
|
Mark M. |
onCreatedView() calls goTo()
|
Mark M. |
goTo() calls loadUrl()
|
Gabriele |
Yes that before my last update when i moved it to oncreatedactivity
|
Gabriele |
I could not update it becuase of my dead connection TT
|
Mark M. |
I don't know what to tell you
|
Nov 26 | 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
|
Gabriele |
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.
|
Gabriele |
Hm
|
Mark M. |
only if you are only encountering this problem on a configuration change or something
|
Mark M. |
wait
|
Mark M. |
what is the *precise* set of steps that is causing your crash?
|
Nov 26 | 5:00 PM |
Gabriele |
I open the browser, open a wiki page, choose my app and then it crashes
|
Nov 26 | 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 |