1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to start others application in Widgets click event ?

Discussion in 'Android Development' started by wong0421, Aug 7, 2010.

  1. wong0421

    wong0421 Lurker
    Thread Starter

    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!
     


  2. blundell

    blundell Well-Known Member

    Here's a little hint to get you started:
    Code (Text):
    1.  
    2. Intent intent = new Intent(Intent.ACTION_VIEW);
    3. intent.setDataAndType(path, "application/pdf");
    4. intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    5.  
    6.  
    7. try {
    8.     startActivity(intent);
    9. }
    10. catch (ActivityNotFoundException e) {
    11.     Toast.makeText(OpenPdf.this,
    12.         "No Application Available to View PDF",
    13.         Toast.LENGTH_SHORT).show();
    14. }
    15.  
    App Intents

    Starting Google Maps Activity
     
Loading...
Similar Threads - start others application
  1. justinedwardfayer
    Replies:
    1
    Views:
    171
  2. Carguy8888
    Replies:
    1
    Views:
    126
  3. Samsung
    Replies:
    1
    Views:
    216
  4. Danz47
    Replies:
    0
    Views:
    1,563
  5. Prabhakar M R
    Replies:
    1
    Views:
    522
  6. Hermitkrab
    Replies:
    11
    Views:
    1,034
  7. Olivianeal
    Replies:
    2
    Views:
    373
  8. Ravindra Pal Singh
    Replies:
    0
    Views:
    648
  9. FredricJLowe
    Replies:
    3
    Views:
    574

Share This Page

Loading...