@@ -105,18 +105,13 @@ public class ListenActivity extends Activity
|
|||||||
|
|
||||||
setContentView(R.layout.activity_listen);
|
setContentView(R.layout.activity_listen);
|
||||||
|
|
||||||
ListenActivity.this.runOnUiThread(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
NotificationCompat.Builder mBuilder =
|
NotificationCompat.Builder mBuilder =
|
||||||
new NotificationCompat.Builder(ListenActivity.this)
|
new NotificationCompat.Builder(ListenActivity.this)
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setOngoing(true)
|
||||||
|
.setSmallIcon(R.drawable.listening_notification)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(getString(R.string.listening));
|
.setContentText(getString(R.string.listening));
|
||||||
|
|
||||||
|
|
||||||
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
||||||
|
|
||||||
final TextView connectedText = (TextView) findViewById(R.id.connectedTo);
|
final TextView connectedText = (TextView) findViewById(R.id.connectedTo);
|
||||||
@@ -124,8 +119,7 @@ public class ListenActivity extends Activity
|
|||||||
|
|
||||||
final TextView statusText = (TextView) findViewById(R.id.textStatus);
|
final TextView statusText = (TextView) findViewById(R.id.textStatus);
|
||||||
statusText.setText(R.string.listening);
|
statusText.setText(R.string.listening);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
_listenThread = new Thread(new Runnable()
|
_listenThread = new Thread(new Runnable()
|
||||||
{
|
{
|
||||||
@@ -166,7 +160,8 @@ public class ListenActivity extends Activity
|
|||||||
statusText.setText(R.string.disconnected);
|
statusText.setText(R.string.disconnected);
|
||||||
NotificationCompat.Builder mBuilder =
|
NotificationCompat.Builder mBuilder =
|
||||||
new NotificationCompat.Builder(ListenActivity.this)
|
new NotificationCompat.Builder(ListenActivity.this)
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setOngoing(false)
|
||||||
|
.setSmallIcon(R.drawable.listening_notification)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(getString(R.string.disconnected));
|
.setContentText(getString(R.string.disconnected));
|
||||||
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
||||||
|
|||||||
@@ -167,11 +167,6 @@ public class MonitorActivity extends Activity
|
|||||||
});
|
});
|
||||||
_serviceThread.start();
|
_serviceThread.start();
|
||||||
|
|
||||||
MonitorActivity.this.runOnUiThread(new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
final TextView addressText = (TextView) findViewById(R.id.address);
|
final TextView addressText = (TextView) findViewById(R.id.address);
|
||||||
|
|
||||||
// Use the application context to get WifiManager, to avoid leak before Android 5.1
|
// Use the application context to get WifiManager, to avoid leak before Android 5.1
|
||||||
@@ -189,8 +184,7 @@ public class MonitorActivity extends Activity
|
|||||||
{
|
{
|
||||||
addressText.setText(R.string.wifiNotConnected);
|
addressText.setText(R.string.wifiNotConnected);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-hdpi-v11/listening_notification.png
Normal file
BIN
app/src/main/res/drawable-hdpi-v11/listening_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-ldpi-v11/listening_notification.png
Normal file
BIN
app/src/main/res/drawable-ldpi-v11/listening_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 590 B |
BIN
app/src/main/res/drawable-mdpi-v11/listening_notification.png
Normal file
BIN
app/src/main/res/drawable-mdpi-v11/listening_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 799 B |
BIN
app/src/main/res/drawable-xhdpi-v11/listening_notification.png
Normal file
BIN
app/src/main/res/drawable-xhdpi-v11/listening_notification.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user