use of android.content.Intent in project kickmaterial by byoutline.
the class CategoriesListActivity method launch.
public static void launch(@Nonnull Activity context, @Nonnull Category category, View sharedElement) {
final Bundle options = KickMaterialBaseActivity.getSharedElementsBundle(context, sharedElement);
Intent intent = new Intent(context, CategoriesListActivity.class);
intent.putExtra(ARG_CATEGORY, Parcels.wrap(category));
ActivityCompat.startActivityForResult(context, intent, DEFAULT_REQUEST_CODE, options);
}
use of android.content.Intent 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.content.Intent in project PlayerHater by chrisrhoden.
the class PlayerHaterService method startSelf.
private void startSelf() {
Intent intent = PlayerHater.buildServiceIntent(getApplicationContext());
intent.putExtra(SELF_STARTER, true);
startService(intent);
}
use of android.content.Intent in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PackageManager pm = getPackageManager();
Intent main = new Intent(Intent.ACTION_MAIN, null);
main.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> launchables = pm.queryIntentActivities(main, 0);
List<ResolveInfo> filtered = new ArrayList<>();
for (ResolveInfo launchable : launchables) {
int launchMode = launchable.activityInfo.launchMode;
if (launchMode != ActivityInfo.LAUNCH_SINGLE_INSTANCE && launchMode != ActivityInfo.LAUNCH_SINGLE_TASK) {
filtered.add(launchable);
}
}
Collections.sort(filtered, new ResolveInfo.DisplayNameComparator(pm));
adapter = new AppAdapter(pm, filtered);
setListAdapter(adapter);
}
use of android.content.Intent in project cw-omnibus by commonsguy.
the class URLHandler method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView uri = (TextView) findViewById(R.id.uri);
if (Intent.ACTION_MAIN.equals(getIntent().getAction())) {
String intentUri = (new Intent("com.commonsware.android.MY_ACTION")).toUri(Intent.URI_INTENT_SCHEME).toString();
uri.setText(intentUri);
Log.w("URLHandler", intentUri);
} else {
Uri data = getIntent().getData();
if (data == null) {
uri.setText("Got com.commonsware.android.MY_ACTION Intent");
} else {
uri.setText(getIntent().getData().toString());
}
}
}
Aggregations