DiscoverySession -> session

This commit is contained in:
Sebastián Katzer 2016-08-01 17:03:30 +02:00
parent daa7112642
commit 2b0bbccc6f

View File

@ -71,7 +71,7 @@ public final class SelectPrinterActivity extends Activity {
/** /**
* Session for printer discovering within the network. * Session for printer discovering within the network.
*/ */
private PrinterDiscoverySession discoverySession; private PrinterDiscoverySession session;
/** /**
* Called when the activity is starting. * Called when the activity is starting.
@ -88,7 +88,7 @@ public final class SelectPrinterActivity extends Activity {
setContentView(Meta.getResId( setContentView(Meta.getResId(
this, "layout", "select_printer_activity")); this, "layout", "select_printer_activity"));
discoverySession = new PrintManager(this).createPrinterDiscoverySession(); session = new PrintManager(this).createPrinterDiscoverySession();
listView = (ListView) findViewById(android.R.id.list); listView = (ListView) findViewById(android.R.id.list);
initListView(); initListView();
@ -101,7 +101,7 @@ public final class SelectPrinterActivity extends Activity {
*/ */
@Override @Override
protected void onDestroy() { protected void onDestroy() {
discoverySession.destroy(); session.destroy();
super.onDestroy(); super.onDestroy();
} }
@ -162,7 +162,7 @@ public final class SelectPrinterActivity extends Activity {
if (pm.getInstalledPrintServices().isEmpty()) if (pm.getInstalledPrintServices().isEmpty())
return; return;
discoverySession.startPrinterDiscovery(); session.startPrinterDiscovery();
} }
/** /**
@ -178,7 +178,7 @@ public final class SelectPrinterActivity extends Activity {
listView.setEmptyView(emptyView); listView.setEmptyView(emptyView);
} }
if (discoverySession.isPrinterDiscoveryStarted()) { if (session.isPrinterDiscoveryStarted()) {
titleView.setText("Searching for printers"); titleView.setText("Searching for printers");
progressBar.setVisibility(View.VISIBLE); progressBar.setVisibility(View.VISIBLE);
} else { } else {
@ -204,7 +204,7 @@ public final class SelectPrinterActivity extends Activity {
* printers. * printers.
*/ */
ListViewAdapter() { ListViewAdapter() {
discoverySession.setOnPrintersChangeListener(new OnPrintersChangeListener() { session.setOnPrintersChangeListener(new OnPrintersChangeListener() {
@Override @Override
public void onPrintersChanged (List<PrinterInfo> printerInfos) { public void onPrintersChanged (List<PrinterInfo> printerInfos) {
printers.addAll(printerInfos); printers.addAll(printerInfos);