{"id":4064,"date":"2014-03-30T07:26:49","date_gmt":"2014-03-30T07:26:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/flurry-context-in-a-fragment-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:26:49","modified_gmt":"2014-03-30T07:26:49","slug":"flurry-context-in-a-fragment-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/flurry-context-in-a-fragment-collection-of-common-programming-errors\/","title":{"rendered":"Flurry context in a Fragment-Collection of common programming errors"},"content":{"rendered":"<p>I need to use Flurry within a <strong>Fragment<\/strong> in my Android app.<\/p>\n<p>I insert the following code in onStart()<\/p>\n<pre><code>@Override\npublic void onStart() {\n    super.onStart();\n    \/\/Log.i(\"About get activity\",\"About get activity \"+getActivity().hashCode());\n    FlurryAgent.onStartSession(getActivity(), \"WXXXXXXXX\");\n}\n<\/code><\/pre>\n<p>and in on stop:<\/p>\n<pre><code>@Override\npublic void onStop() {\n    FlurryAgent.onEndSession(getActivity());\n    super.onStop();\n}\n<\/code><\/pre>\n<p>Is this code correct? Do I pass the context as getActivity(), this or something else?<\/p>\n<p>Thanks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to use Flurry within a Fragment in my Android app. I insert the following code in onStart() @Override public void onStart() { super.onStart(); \/\/Log.i(&#8220;About get activity&#8221;,&#8221;About get activity &#8220;+getActivity().hashCode()); FlurryAgent.onStartSession(getActivity(), &#8220;WXXXXXXXX&#8221;); } and in on stop: @Override public void onStop() { FlurryAgent.onEndSession(getActivity()); super.onStop(); } Is this code correct? Do I pass the context [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4064","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4064"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4064\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}