Search in sources :

Example 66 with Intent

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);
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 67 with Intent

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);
}
Also used : KeyEvent(android.view.KeyEvent) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent)

Example 68 with Intent

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);
}
Also used : Intent(android.content.Intent) PendingIntent(android.app.PendingIntent)

Example 69 with 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);
}
Also used : ResolveInfo(android.content.pm.ResolveInfo) PackageManager(android.content.pm.PackageManager) ArrayList(java.util.ArrayList) Intent(android.content.Intent)

Example 70 with Intent

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());
        }
    }
}
Also used : TextView(android.widget.TextView) Intent(android.content.Intent) Uri(android.net.Uri)

Aggregations

Intent (android.content.Intent)30598 PendingIntent (android.app.PendingIntent)4802 Test (org.junit.Test)2560 View (android.view.View)2527 Bundle (android.os.Bundle)2094 ComponentName (android.content.ComponentName)1706 TextView (android.widget.TextView)1660 Uri (android.net.Uri)1607 Context (android.content.Context)1506 ResolveInfo (android.content.pm.ResolveInfo)1397 PackageManager (android.content.pm.PackageManager)1125 ArrayList (java.util.ArrayList)1067 IntentFilter (android.content.IntentFilter)917 ImageView (android.widget.ImageView)904 ActivityNotFoundException (android.content.ActivityNotFoundException)859 File (java.io.File)823 RemoteException (android.os.RemoteException)786 DialogInterface (android.content.DialogInterface)752 IOException (java.io.IOException)742 SharedPreferences (android.content.SharedPreferences)665