Question: can't wrap my mind around adding partitions to the existing partitioned table in Pivotal Greenplum via this [documentation](https://docs.greenplum.org/6-1/ref_guide/sql_commands/ALTER_TABLE.html)

```
create table tab_name
(
    day_dt date,
    id text,
    s_id text,
    type text,
    amt numeric(19,4)
)
distributed randomly
partition by range (day_dt)
    (
    start (date '2020-09-18') inclusive
    end (date '2020-10-02') exclusive
    every (interval '1 day')
    );

```

This is DDL.
I need to add new partitions to every new day since 2020-10-02 before adding data to the table.

```
ALTER TABLE tab_name ADD PARTITION
             START (date '2020-10-02') INCLUSIVE
             END (date '2020-11-01') EXCLUSIVE;

```

But this one would create only one partition, and I need on every day.

Answer: 
For many (perhaps most) `PackageManager` methods, on Android 11 and higher, you need to take into account [package visibility rules](https://developer.android.com/training/package-visibility) and [add a `<queries>` element to your manifest](https://developer.android.com/training/package-visibility/declaring) to declare what third-party apps you are interest in discovering or analyzing.
If you know the package name of the app you want to launch at build-time, then see CommonsWare's answer, as this will work on Android 11+. For my case I don't know the package name at build-time because we get it from a server call, so I can't put that in my manifest. I had to take a different approach.

If you know the activity name of the package you are trying to launch, you don't **need** to call `getLaunchIntentForPackage`, as you can replicate its behaviour yourself. If you [look at the source](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/app/ApplicationPackageManager.java) for `getLaunchIntentForPackage`, the `PackageManager` is used only to get the activity class name for the package being launched.

So here's my re-implementation which works on Android 11+ if you already know the activity class name:

```
// you have String variables packageName and className (fully-qualified)
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setPackage(packageName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(packageName, className);
startActivity(intent);

```

---

PS: If you do know the app package name, but don't know the activity name, probably the best way to get the activity name is just to run `getLaunchIntentForPackage` on an earlier version of Android (version 10 or below) where that app is installed, and get the activity name from the resulting intent (`intent.getComponent().getClassName()`).

For example, for YouTube the values would be:

* `packageName = "com.google.android.youtube"`
* `className = "com.google.android.youtube.app.honeycomb.Shell$HomeActivity"`