Android hc gallery example
I am trying to use custom notification from hc gallery example. http://developer.android.com/resources/samples/HoneycombGallery/src/com/example开发者_如何学Python/android/hcgallery/MainActivity.html
I am not able to understand the variable defined for ACTION_DIALOG private static final String ACTION_DIALOG = "com.example.android.hcgallery.action.DIALOG";
What is it and what should I use in my application.
ACTION_DIALOG is a String constant that actually makes it easier to check the action set on an intent that actually gets created in the MainActivity itself. What it is really doing is when the app calls on the onNewIntent() the programmer made that happen every time for a way to display Dialog Fragments easily. If the new intent in the class has an action of DIALOG it then calls the showDialog() which makes a DialogFragment and displays it to the user. Using String constants in JAVA is a good idea for a lot of reasons.
精彩评论