Back to project page Tip_Calculator.
The source code is released under:
Apache License
If you think the Android project Tip_Calculator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.collinguarino.tipcalculator; //w ww . j a va 2s . c o m import android.content.Intent; import com.google.android.apps.dashclock.api.DashClockExtension; import com.google.android.apps.dashclock.api.ExtensionData; /** * Created by collinux on 7/24/14. */ public class TipCalculatorDashClock extends DashClockExtension { private static final String TAG = "ExampleExtension"; public static final String PREF_NAME = "pref_name"; @Override protected void onUpdateData(int reason) { // Get preference value. /*SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); String name = sp.getString(PREF_NAME, getString(R.string.pref_name_default));*/ Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.collinguarino.tipcalculator"); // Publish the extension data update. publishUpdate(new ExtensionData() .visible(true) .icon(R.drawable.app_icon) .status("Tip Calculator") //.expandedTitle("Flashlight") /*.expandedBody("Thanks for checking out this example extension for DashClock.") .contentDescription("Completely different text for accessibility if needed.")*/ .clickIntent(launchIntent)); } }