2

Anyone knows the intent to search directly through the official Duckduckgo app on Android?

Tried this one so far, i think they dont have a query key in extras

    Intent intent = new Intent(Intent.ACTION_SEARCH);
    intent.setPackage("com.duckduckgo.mobile.android");
    intent.putExtra("query", subject);
    context.startActivity(intent);
GGWP
  • 1,111
  • 2
  • 12
  • 24
  • found their github [link](https://github.com/duckduckgo) it would be a pain to tinker – GGWP May 23 '18 at 07:41

1 Answers1

1

It is actually pretty simple than i thought

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("https://duckduckgo.com/?q=" + subject));

    try {
        intent.setPackage("com.duckduckgo.mobile.android");
        context.startActivity(intent);
    } catch (ActivityNotFoundException a) {
        intent.setPackage(null);
        context.startActivity(intent);
    }
GGWP
  • 1,111
  • 2
  • 12
  • 24