Android journey 1@ 인코딩 스타일 및 이름 지정 사양

6107 단어
/*
* 1.      :                   ,               ,  
*           ,                         ,          
*      。                 ,          “      ”   ,   
*          ,        ,  “          ”,         ,     
*                    ,     ,    ,     。       :
*/
/*
* 1)  Project         :(             )
*    #.Requirement Doc: project       
*    #.Design:         
*    #.Planning&Log:  、  、   
*    #.Test:      
*    #.Study:     demo
*    #.Deployment:  ,  
*    #.src:    
*    #.help:    
*    #. ...(            )
*        : IDE  project   ,    (java),     ,      3 ,   :【  】.【  】.【  】
*/
/*
* 2)    :
*    #、Pascal   :         ,    , “ActivityDemo”,     :   ,    ,     
*    #、Camel   :        ,     pascal  , “myName”,     :   (    ),      
*    #、      (    ,    ):       ,  “int intMyAge;”
*    #、      :     (   )   ,        
*          :      :“mMyName”;    :“sMyName”;    :“pMyName”;
*                       ,        ,              
*/
/*
* 3)         :
*   1、       35   
*   2、              
*   3、final String  String,         
*   4、       return
*   5、   set(),get()    
*   6、               ,             
*   7、  class     ,            
*   8、switch          default
*   9、   import     
*   ...
* */ // Android : /* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.app; import com.android.internal.app.ActionBarImpl; import com.android.internal.policy.PolicyManager; import android.os.Build; import android.os.Bundle; import android.os.UserHandle; import android.text.Selection; import android.text.SpannableStringBuilder; import android.text.TextUtils; import android.text.method.TextKeyListener; import android.util.AttributeSet; import android.util.EventLog; /** HTML , javadoc * An activity is a single, focused thing that the user can do. Almost all * activities interact with the user, so the Activity class takes care of * creating a window for you in which you can place your UI with * {@link #setContentView}. While activities are often presented to the user * as full-screen windows, they can also be used in other ways: as floating * windows (via a theme with {@link android.R.attr#windowIsFloating} set) * or embedded inside of another activity (using {@link ActivityGroup}). * * There are two methods almost all subclasses of Activity will implement: * *
    *
  • {@link #onCreate} is where you initialize your activity. Most * importantly, here you will usually call {@link #setContentView(int)} * with a layout resource defining your UI, and using {@link #findViewById} * to retrieve the widgets in that UI that you need to interact with * programmatically. * *
  • {@link #onPause} is where you deal with the user leaving your * activity. Most importantly, any changes made by the user should at this * point be committed (usually to the * {@link android.content.ContentProvider} holding the data). *
... */ public class Activity extends ContextThemeWrapper implements LayoutInflater.Factory2, Window.Callback, KeyEvent.Callback, OnCreateContextMenuListener, ComponentCallbacks2 { private static final String TAG = "Activity"; private static final boolean DEBUG_LIFECYCLE = false; /** Standard activity result: operation canceled. */ // public static final int RESULT_CANCELED = 0; /** Standard activity result: operation succeeded. */ public static final int RESULT_OK = -1; /** Start of user-defined activity results. */ public static final int RESULT_FIRST_USER = 1; static final String FRAGMENTS_TAG = "android:fragments"; private static final String WINDOW_HIERARCHY_TAG = "android:viewHierarchyState"; private static final String SAVED_DIALOG_IDS_KEY = "android:savedDialogIds"; private static final String SAVED_DIALOGS_TAG = "android:savedDialogs"; private static final String SAVED_DIALOG_KEY_PREFIX = "android:dialog_"; private static final String SAVED_DIALOG_ARGS_KEY_PREFIX = "android:dialog_args_"; private static class ManagedDialog { Dialog mDialog; Bundle mArgs; } private SparseArray mManagedDialogs; // set by the thread after the constructor and before onCreate(Bundle savedInstanceState) is called. // private Instrumentation mInstrumentation; private IBinder mToken; private int mIdent; static final class NonConfigurationInstances { Object activity; HashMap children; ArrayList fragments; HashMap loaders; } /* package */ NonConfigurationInstances mLastNonConfigurationInstances; private Window mWindow; /** * Change the intent returned by {@link #getIntent}. This holds a * reference to the given intent; it does not copy it. Often used in * conjunction with {@link #onNewIntent}. * * @param newIntent The new Intent object to return from getIntent * * @see #getIntent * @see #onNewIntent * javadoc *@author .. *@date .. *@modify ..(who,when..) */ public void setIntent(Intent newIntent) { mIntent = newIntent; }



전재 대상:https://www.cnblogs.com/allenpengyu/p/3495156.html

좋은 웹페이지 즐겨찾기