自分用のメモ
Get Started with the Developer Preview | Android Developers
$adb -d forward tcp:5601 tcp:5601
int notificationId = 1;
Intent viewIntent = new Intent(this, CallActivity.class);
viewIntent.putExtra("key", "value");
PendingIntent viewPendingIntent =
PendingIntent.getActivity(this, 0, viewIntent, 0);
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("ContentTitle")
.setContentText("ContentText")
.setContentIntent(viewPendingIntent);
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
notificationManager.notify(notificationId, notificationBuilder.build());
int notificationId = 1;
Intent viewIntent = new Intent(this, CallActivity.class);
viewIntent.putExtra("key", "value");
PendingIntent viewPendingIntent =
PendingIntent.getActivity(this, 0, viewIntent, 0);
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri geoUri = Uri.parse("geo:0,0?q=100,100");
mapIntent.setData(geoUri);
PendingIntent mapPendingIntent =
PendingIntent.getActivity(this, 0, mapIntent, 0);
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText("Big Text");
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_event)
.setLargeIcon(BitmapFactory.decodeResource(
getResources(), R.drawable.ic_bigicon))
.setContentTitle("ContentTitle")
.setContentText("ContentText")
.setContentIntent(viewPendingIntent)
.addAction(R.drawable.ic_map,"Map", mapPendingIntent)
.setStyle(bigStyle);
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
notificationManager.notify(notificationId, notificationBuilder.build());