first cut at accepting input when running. Won't work when whole app is in background.

This commit is contained in:
Eric House 2016-04-06 11:08:27 -07:00
parent 347ff60434
commit 919e44f21e

View file

@ -47,6 +47,7 @@ public class ChatDelegate extends DelegateBase {
private static final String INTENT_KEY_NAMES = "intent_key_names"; private static final String INTENT_KEY_NAMES = "intent_key_names";
private static final String INTENT_KEY_LOCS = "intent_key_locs"; private static final String INTENT_KEY_LOCS = "intent_key_locs";
private static ChatDelegate s_visibleThis;
private long m_rowid; private long m_rowid;
private int m_curPlayer; private int m_curPlayer;
private String[] m_names; private String[] m_names;
@ -116,6 +117,7 @@ public class ChatDelegate extends DelegateBase {
@Override @Override
protected void onResume() protected void onResume()
{ {
s_visibleThis = this;
m_jniThreadRef = JNIThread.getRetained( m_rowid ); m_jniThreadRef = JNIThread.getRetained( m_rowid );
Assert.assertNotNull( m_jniThreadRef ); Assert.assertNotNull( m_jniThreadRef );
super.onResume(); super.onResume();
@ -125,6 +127,7 @@ public class ChatDelegate extends DelegateBase {
protected void onPause() protected void onPause()
{ {
m_jniThreadRef.release(); m_jniThreadRef.release();
s_visibleThis = null;
super.onPause(); super.onPause();
} }
@ -219,6 +222,15 @@ public class ChatDelegate extends DelegateBase {
} }
} }
public static boolean append( long rowid, String msg, int fromIndx )
{
boolean handled = null != s_visibleThis
&& s_visibleThis.m_rowid == rowid;
if ( handled ) {
s_visibleThis.addRow( msg, fromIndx );
}
return handled;
}
public static void startForResult( Delegator delegator, public static void startForResult( Delegator delegator,
RequestCode requestCode, RequestCode requestCode,