Updated docs for next

This commit is contained in:
Website Deployment Script
2016-07-29 22:50:24 +00:00
parent 0a37a19d8e
commit e9f65fdf16
@@ -312,7 +312,11 @@ AppRegistry<span class="token punctuation">.</span><span class="token function">
public void <span class="token function">invokeDefaultOnBackPressed<span class="token punctuation">(</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
super<span class="token punctuation">.</span><span class="token function">onBackPressed<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></div><blockquote><p>A <code>ReactInstanceManager</code> can be shared amongst multiple activities and/or fragments. You will want to make your own <code>ReactFragment</code> or <code>ReactActivity</code> and have a singleton <em>holder</em> that holds a <code>ReactInstanceManager</code>. When you need the <code>ReactInstanceManager</code> (e.g., to hook up the <code>ReactInstanceManager</code> to the lifecycle of those Activities or Fragments) use the one provided by the singleton.</p></blockquote><p>Next, we need to pass some activity lifecycle callbacks down to the <code>ReactInstanceManager</code>:</p><div class="prism language-javascript">@Override
<span class="token punctuation">}</span></div><p>We need set the theme of <code>MyReactActivity</code> to <code>Theme.AppCompat.Light.NoActionBar</code> beause some components rely on this theme.</p><div class="prism language-javascript">&lt;activity
android<span class="token punctuation">:</span>name<span class="token operator">=</span><span class="token string">&quot;.MyReactActivity&quot;</span>
android<span class="token punctuation">:</span>label<span class="token operator">=</span><span class="token string">&quot;@string/app_name&quot;</span>
android<span class="token punctuation">:</span>theme<span class="token operator">=</span><span class="token string">&quot;@style/Theme.AppCompat.Light.NoActionBar&quot;</span><span class="token operator">&gt;</span>
&lt;<span class="token operator">/</span>activity<span class="token operator">&gt;</span></div><blockquote><p>A <code>ReactInstanceManager</code> can be shared amongst multiple activities and/or fragments. You will want to make your own <code>ReactFragment</code> or <code>ReactActivity</code> and have a singleton <em>holder</em> that holds a <code>ReactInstanceManager</code>. When you need the <code>ReactInstanceManager</code> (e.g., to hook up the <code>ReactInstanceManager</code> to the lifecycle of those Activities or Fragments) use the one provided by the singleton.</p></blockquote><p>Next, we need to pass some activity lifecycle callbacks down to the <code>ReactInstanceManager</code>:</p><div class="prism language-javascript">@Override
protected void <span class="token function">onPause<span class="token punctuation">(</span></span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
super<span class="token punctuation">.</span><span class="token function">onPause<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span>