• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to start others application in Widgets click event ?

wong0421

Lurker
Aug 6, 2010
2
0
I designed a widget and successful using "setOnClickPendingIntent" to active the click event, but I want to start other application witch is install in my Android phone (such as Google Map), how can I using in this following command?

if (intent.getAction().equals(ACTION_WIDGET_CLICK)) { .... }

Beside that, My widget is a clock widget, I want to click a button to start the "system clock page" and click the date to the system Calendar. How can I make it? many thanks!
 
Here's a little hint to get you started:
Code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);


try {
    startActivity(intent);
} 
catch (ActivityNotFoundException e) {
    Toast.makeText(OpenPdf.this, 
        "No Application Available to View PDF", 
        Toast.LENGTH_SHORT).show();
}
App Intents

Starting Google Maps Activity
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones