Fix comments from pull-request review
This commit is contained in:
@@ -36,11 +36,12 @@ import android.support.v4.app.NotificationManagerCompat;
|
|||||||
public class ListenActivity extends Activity
|
public class ListenActivity extends Activity
|
||||||
{
|
{
|
||||||
final String TAG = "BabyMonitor";
|
final String TAG = "BabyMonitor";
|
||||||
|
// Sets an ID for the notification
|
||||||
|
final static int mNotificationId = 1;
|
||||||
|
|
||||||
String _address;
|
String _address;
|
||||||
int _port;
|
int _port;
|
||||||
String _name;
|
String _name;
|
||||||
Context _mParentContext = this;
|
|
||||||
NotificationManagerCompat _mNotifyMgr;
|
NotificationManagerCompat _mNotifyMgr;
|
||||||
|
|
||||||
Thread _listenThread;
|
Thread _listenThread;
|
||||||
@@ -100,7 +101,7 @@ public class ListenActivity extends Activity
|
|||||||
_name = b.getString("name");
|
_name = b.getString("name");
|
||||||
// Gets an instance of the NotificationManager service
|
// Gets an instance of the NotificationManager service
|
||||||
_mNotifyMgr =
|
_mNotifyMgr =
|
||||||
NotificationManagerCompat.from(_mParentContext);
|
NotificationManagerCompat.from(this);
|
||||||
|
|
||||||
setContentView(R.layout.activity_listen);
|
setContentView(R.layout.activity_listen);
|
||||||
|
|
||||||
@@ -110,14 +111,12 @@ public class ListenActivity extends Activity
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
NotificationCompat.Builder mBuilder =
|
NotificationCompat.Builder mBuilder =
|
||||||
new NotificationCompat.Builder(_mParentContext)
|
new NotificationCompat.Builder(ListenActivity.this)
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setSmallIcon(R.drawable.ic_launcher)
|
||||||
.setContentTitle("Baby Monitor Listener")
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText("Listener is running");
|
.setContentText(getString(R.string.listening));
|
||||||
|
|
||||||
|
|
||||||
// Sets an ID for the notification
|
|
||||||
int mNotificationId = 1;
|
|
||||||
_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);
|
||||||
@@ -166,12 +165,10 @@ 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.disconnected);
|
statusText.setText(R.string.disconnected);
|
||||||
NotificationCompat.Builder mBuilder =
|
NotificationCompat.Builder mBuilder =
|
||||||
new NotificationCompat.Builder(_mParentContext)
|
new NotificationCompat.Builder(ListenActivity.this)
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setSmallIcon(R.drawable.ic_launcher)
|
||||||
.setContentTitle("Baby Monitor Listener")
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText("Disconnected!");
|
.setContentText(getString(R.string.disconnected));
|
||||||
// Sets an ID for the notification
|
|
||||||
int mNotificationId = 1;
|
|
||||||
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
_mNotifyMgr.notify(mNotificationId, mBuilder.build());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user