
With an implicit intent you do not provide a specific class to start, instead you specify an action that other apps can choose to act upon. The correct way to start an activity outside of your application is to use a Implicit intent. In this way, I can run a default clock manager. PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, alarmClockIntent, 0) Intent alarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER) įor(int i=0 i " + packageName + "/" + className) PackageManager packageManager = context.getPackageManager()
#Open world clock how to#
Plus i don not know the package names for all.Īnyone knows how to overcome this please help. There must be a better solution than creating an if statement for every android phone flavor i the world. I found out that on droids with 2.2 does not work. I made the above so the when i touch the clock opens the alarm settings. Intent AlarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("", "")) this worked on my htc magic with 1.5 and 1.6 tOnClickPendingIntent(R.id.Widget, pendingIntent) ĪppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views) PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, AlarmClockIntent, 0) RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget)

this is the code: //this worked on my nexus 2.1 I want the user to touch the clock and launch the clock app on the phone. I am facing a problem with a clock widget i made.
