Android: various bug fixes to prevent NullPointerExceptions

This commit is contained in:
Martin Fleisz 2013-06-26 06:50:10 -07:00
parent 4d47514428
commit 77f8ca315e
2 changed files with 11 additions and 2 deletions

View File

@ -248,6 +248,9 @@ public class SessionActivity extends Activity
{
Log.v(TAG, "OnConnectionFailure");
// remove pending move events
uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT);
if(progressDialog != null)
{
progressDialog.dismiss();
@ -264,7 +267,10 @@ public class SessionActivity extends Activity
private void OnDisconnected(Context context)
{
Log.v(TAG, "OnDisconnected");
// remove pending move events
uiHandler.removeMessages(UIHandler.SEND_MOVE_EVENT);
if(progressDialog != null)
{
progressDialog.dismiss();
@ -434,6 +440,7 @@ public class SessionActivity extends Activity
keyboardMapper = new KeyboardMapper();
keyboardMapper.init(this);
keyboardMapper.reset(this);
modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard);
specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard);

View File

@ -65,7 +65,9 @@ public abstract class ClipboardManagerProxy {
String data = null;
if (clip != null && clip.getItemCount() > 0) {
data = clip.getItemAt(0).getText().toString();
CharSequence cs = clip.getItemAt(0).getText();
if (cs != null)
data = cs.toString();
}
if (mListener != null) {
mListener.onClipboardChanged(data);