
org.robolectric.fakes.RoboIntentSender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.fakes;
import android.app.PendingIntent;
import android.content.Context;
import android.content.IIntentSender;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.os.Handler;
/**
* Robolectric implementation of {@link android.content.IntentSender}.
*/
public class RoboIntentSender extends IntentSender {
public Intent intent;
private PendingIntent pendingIntent;
public RoboIntentSender(PendingIntent pendingIntent) {
super((IIntentSender)null);
this.pendingIntent = pendingIntent;
}
@Override public void sendIntent(Context context, int code, Intent intent,
final OnFinished onFinished, Handler handler, String requiredPermission)
throws SendIntentException {
try {
pendingIntent.send(context, code, intent);
} catch (PendingIntent.CanceledException e) {
throw new SendIntentException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy