Android: Make sure there are messages to display

This commit is contained in:
Rom Walton 2013-02-19 00:07:57 -05:00 committed by Oliver Bock
parent ba40a6a525
commit dc6aee4dcc
1 changed files with 7 additions and 7 deletions

View File

@ -417,14 +417,14 @@ public class Monitor extends Service {
if(showRpcCommands) Log.d(TAG, "getGlobalPrefsWorkingStruct");
GlobalPreferences clientPrefs = rpc.getGlobalPrefsWorkingStruct();
ArrayList<Message> msgs = new ArrayList<Message>();
if(getResources().getBoolean(R.bool.tab_debug)) { //retrieve messages only when debug tab is enabled
Integer count = rpc.getMessageCount();
if(showRpcCommands) Log.d(TAG, "getMessages, count: " + count);
msgs = rpc.getMessages(count - 25); //get the most recent 25 messages
}
Integer count = rpc.getMessageCount();
msgs = rpc.getMessages(count - 250); //get the most recent 250 messages
if(showRpcCommands) Log.d(TAG, "getMessages, count: " + count);
if((status!=null)&&(results!=null)&&(projects!=null)&&(transfers!=null)&&(clientPrefs!=null)) {
Monitor.clientStatus.setClientStatus(status,results,projects,transfers,clientPrefs,msgs);
if( (status != null) && (results != null) && (projects != null) && (transfers != null) &&
(clientPrefs != null)
) {
Monitor.clientStatus.setClientStatus(status, results, projects, transfers, clientPrefs, msgs);
} else {
BOINCActivity.logMessage(getApplicationContext(), TAG, "client status connection problem");
}