use of android.app.PendingIntent in project cw-omnibus by commonsguy.
the class ProjectorService method buildForegroundNotification.
@Override
protected void buildForegroundNotification(NotificationCompat.Builder b) {
Intent iActivity = new Intent(this, MainActivity.class);
PendingIntent piActivity = PendingIntent.getActivity(this, 0, iActivity, 0);
b.setContentTitle(getString(R.string.app_name)).setContentIntent(piActivity).setSmallIcon(R.mipmap.ic_launcher).setTicker(getString(R.string.app_name));
}
use of android.app.PendingIntent in project cw-omnibus by commonsguy.
the class ScreenshotService method buildPendingIntent.
private PendingIntent buildPendingIntent(String action) {
Intent i = new Intent(this, getClass());
i.setAction(action);
return (PendingIntent.getService(this, 0, i, 0));
}
use of android.app.PendingIntent in project PlayerHater by chrisrhoden.
the class TouchableNotificationPlugin method getMediaButtonPendingIntent.
private PendingIntent getMediaButtonPendingIntent(int keycode) {
Intent intent = new Intent(getContext(), BroadcastReceiver.class);
intent.setAction(Intent.ACTION_MEDIA_BUTTON);
intent.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, keycode));
return PendingIntent.getBroadcast(getContext(), keycode, intent, 0);
}
use of android.app.PendingIntent in project cw-advandroid by commonsguy.
the class InterpreterService method send.
private void send(Intent intent, Intent data) {
String broadcast = intent.getStringExtra(BROADCAST_ACTION);
if (broadcast == null) {
PendingIntent pi = (PendingIntent) intent.getParcelableExtra(PENDING_RESULT);
if (pi != null) {
try {
pi.send(this, Activity.RESULT_OK, data);
} catch (PendingIntent.CanceledException e) {
// no-op -- client must be gone
}
}
} else {
data.setPackage(intent.getStringExtra(BROADCAST_PACKAGE));
data.setAction(broadcast);
sendBroadcast(data);
}
}
use of android.app.PendingIntent in project cw-advandroid by commonsguy.
the class BshService method send.
private void send(Intent intent, String result, int code) {
String broadcast = intent.getStringExtra(BROADCAST_ACTION);
Intent data = new Intent();
data.putExtra(PAYLOAD, result);
data.putExtra(RESULT_CODE, code);
if (broadcast == null) {
PendingIntent pi = (PendingIntent) intent.getParcelableExtra(PENDING_RESULT);
if (pi != null) {
try {
pi.send(this, Activity.RESULT_OK, data);
} catch (PendingIntent.CanceledException e) {
// no-op -- client must be gone
}
}
} else {
data.setPackage(intent.getStringExtra(BROADCAST_PACKAGE));
data.setAction(broadcast);
sendBroadcast(data);
}
}
Aggregations