Apps How to start others application in Widgets click event ?

wong0421

Lurker
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!
 

blundell

Well-Known Member
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
 
Top