MCPcopy Create free account
hub / github.com/cuberite/cuberite / AddToLog

Method AddToLog

Android/src/com/mcserver/MCServerActivity.java:218–239  ·  view source on GitHub ↗
( final String logMessage )

Source from the content-addressed store, hash-verified

216
217
218 public void AddToLog( final String logMessage ) {
219 final ListView lv = ((ListView)findViewById(R.id.listView1));
220 lv.post(new Runnable() {
221 public void run() {
222 //final boolean bAutoscroll = lv.getLastVisiblePosition() >= mAdapter.getCount() - 1 ? true : false;
223
224 mLogList.add(logMessage);
225 while( mLogList.size() > 100 ) // only allow 100 messages in the list, otherwise it might slow the GUI down
226 {
227 mLogList.remove(0);
228 }
229 mAdapter.notifyDataSetChanged();
230
231
232 // Autoscroll detection is dodgy
233 //if( bAutoscroll )
234 {
235 lv.setSelection(mAdapter.getCount() - 1);
236 }
237 }
238 });
239 }
240
241
242

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected