![]() ![]() ON THE CLOCK APP TRIALThus, your app is going to be constantly breaking on new phones, if you rely on being able to open the clock app. Time clock app with 14 day free trial for clock-in and clock-out. I would suggest against trying to create a huge if statement like you have, since the app could be different not only with different sdk versions, but with different phones since the phone manufacturers can choose to replace apps. If the clock apps don't have this, then there is no good way to accomplish what you want. Unfortunately, you need to app developers to agree to all implement a particular action in order for this to work. See intents and intent filters for more details on implicit intents. Additionally, the app does countdown alarms, recurring alarms, and one-time alarms. You can set an unlimited number of alarms. Also, it allows multiple apps to respond to the same action. Alarm Clock for Heavy Sleepers is a simple, but effective app. This is to prevent breakage in your app when the creator of the other app decides to rename their class, or some such. 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() ON THE CLOCK APP HOW TOPlus i don not know the package names for all.Īnyone knows how to overcome this please help. ON THE CLOCK APP ANDROIDThere 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) It is possible to use Huge Digital Clock to automatically start the app when the phone is charging. This app uses the system alarm app for the alarm clock. this is the code: //this worked on my nexus 2.1 Option to close the app if the battery is low. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |