• SetBackgroundResource (0) removes the background color of the View

  • Resources.getsystem ().getDisplayMetrics().density can be used to obtain screen density without using Context

  • A simple mask effect can be achieved by overloading the ViewGroup dispatchDraw. For example, when you pull down a refresh, you can put a mask over the contentView. canvas.drawRect(0, mContentView.getTranslationY(), getWidth(), getHeight(), mMaskPaint);

  • GenerateViewId () (API 17 and above) generates an ID that is guaranteed to be unique

  • Android: Padding and Android :clipToPadding=”false” work better together when using a GridView.

  • In layout files, Space can be used instead of View if it is just for Space. The best part is that Space skips Draw.

  • ApplyDimension (int Unit, float Value, DisplayMetrics metrics) to facilitate conversion between DP, PX, sp.

  • The activity.startActivities () method is best understood as starting multiple activities with intents

  • Textutils.isempty () returns true if the String passed in is NULL or Length is 0.

  • Html.fromhtml () If you’re familiar with Html, you can quickly use this method to handle some rich text operations. Such as hyperlinks and graphic typesetting.

  • Textview.seterror () sets text box error alerts

  • Build.version_codes Sometimes our apps need to perform different operations according to different SDK versions

  • PhoneNumberUtils convertKeypadLettersToDigits this method simple and crude, will convert the letters according to the map on the keyboard input number.

  • ArgbEvaluator ArgbEvaluator.evaluate(float fraction, Object startValue, Object endValue); Generate a new color according to a start color value and an end color value and an offset, and achieve a color gradient similar to wechat bottom bar sliding in minutes.

  • Valueanimator.reverse () smoothly unanimates

  • Dateutils.formatdatetime ()) this method outputs the time or date that is formatted accordingly

  • Formatter.formatfilesize () This method formats the size of the data, returning B KB MB GB and so on (up to PB supported), depending on the size of the input bytes. Note, of course, that the maximum input is long.max_value.

  • TypedValue. ApplyDimension () first of all, this method we can use to the sp unit conversion between dp and px. I think many of you have used it

  • The pair.create () class can be used to store a “group” of data. But not key and value.

  • SparseArray currently has a number of areas from the performance optimizer side to use SparseArray instead of hashMap to save memory and improve performance.

  • The linkify.addLinks () class makes it easier to add hyperlinks to text.

  • android.text.Spanned

  • ThumbnailUtils is a class that handles thumbnail related content. If you’ve ever needed it, you’ve probably used this class.

  • Bitmap.extractAlpha (); Returns a new Bitmap to capture the alpha value of the original image. Sometimes we need to dynamically change the background image of an element without using multiple images. With this method, we can dynamically change the color of a solid Bitmap using Canvas and Paint.

  • When messages need to be transmitted between modules, LocalBroadcastManager is used instead of Listener for module decoupling. In addition to decoupling, the difference between sending and executing messages by a thread loop can reduce the chain of method calls, and I had a problem with StackOverflow when the chain of method calls was too long.

  • Static variables should not refer directly or indirectly to activities, services, etc. This uses the Activity and all the objects it references and can’t be released, and then, as the user works for a long time, memory explodes.

  • The Handler mechanism does not end with the end of the Activity or Service lifecycle. That is, if you Post a Delay Runnable and then exit the Activity before the Runnable is executed, the Runnable will still be executed after the time. If Runnable contains operations to update the View, the program crashes.

  • RunOnUiThread many people like to use context.runonuithRead when updating views in child threads. The disadvantage of this method is that it will crash once the Context lifecycle is over, such as when the Activity has been destroyed.

  • SharedPreferences.Editor.com MIT this method is synchronous, until after the data synchronization to Flash will return, uncontrolled by IO operations, try to use the apply method instead. Apply is only supported when API Level>=9. However, the latest support v4 package has prepared for us deal with, use SharedPreferencesCompat. EditorCompat. GetInstance (). The apply (editor).

  • PackageManager getInstalledPackages this method is often used, you may not know, when to obtain the result of the quantity is more, in some models the above call it may take seconds, so try to use in the child thread. In addition, if there are too many results that exceed the Binder’s maximum data transfer limit, a TransactionException will occur. If you use this method to get a list of installed applications on your machine, take precautions.

  • If you use context. startActivity to start an external application, it is a good idea to do exception prevention, because an exception will be thrown if the corresponding application cannot be found. If you want to start an in-app Activity, don’t use an explicit Intent to improve the system’s ability to find the target Activity.

  • The Application life cycle is the process life cycle. The Application is destroyed only if the process is killed. Application exists even when no Activity or Service is running. Therefore, in order to reduce memory stress, try not to reference large objects, contexts, etc.

  • getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); Always set the full-screen method after setContentView

  • Viewpager’s setCurrentItem must be called after the setAdapter method to be effective.

  • Figure out whether mobile flight mode Boolean isEnabled = Settings. The System. Get int (context) getContentResolver (), Settings, System. AIRPLANE_MODE_ON, 0) = = 1;

  • The official TabLayout does not provide a method for changing the size of a TextView. . You can create a new style CustomTabLayoutTextAppearance inheritance TextAppearance AppCompat. Widget. The ActionBar. The Title. The Inverse, then add the item, Set Android :textAllCaps to true, and then set Android :textSize to the size you want.In the layout file of TabLayout Settings app: tabTextAppearance = “@ style/CustomTabLayoutTextAppearance”.

  • The best way to traverse a HashMap

public static void printMap(Map mp) {
    Iterator it = mp.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry pair = (Map.Entry)it.next();
        System.out.println(pair.getKey() + " = " + pair.getValue());
        it.remove(); // avoids a ConcurrentModificationException
    }
}

public static int randInt(int min, int max) {
    Random rand;
    int randomNum = rand.nextInt((max - min) + 1) + min;
    return randomNum;
}

  • If a subclass implements the Serializable interface but the parent class does not, the parent class will not be serialized, but the parent class must have a no-argument constructor, otherwise InvalidClassException will be thrown.

  • Transient keyword modifier variables can limit serialization.

  • When using JakeWharton TabPageIndicator, if you need to do some time-consuming operation, and then show TabPageIndicator, first need to set up mIndirector. SetVisibility (View. GONE); And then after the time-consuming tasks mIndirector. SetVisibility (the VISIBLE). Otherwise, an error will be reported

  • Order of calls between class inheritances Parent Class Static Member -> Subclass Static Member -> Parent Class Ordinary Member Initializer and Initialization block -> Parent class Constructor -> Subclass ordinary Member Initializer and initialization block -> Subclass constructor

  • Go to “ProjectMenu” -> “Background Setting” -> “log” Service menu will appear Setting”Open “Log switch” and set it to ON.Open “Log level setting” and set the log level you wish.

  • The Intent in onStartCommand() passes the null parameter. OnStartCommand (intent, service.start_redeliver_intent, startId); Can solve the problem. Here are the meanings of several flags

  • flag explain
    START_STICKY If the service process is killed, the service remains in the start state, but the intent object delivered is not. The onStartCommand(Intent,int,int) method is called after the service is created. If no start command is passed to the service during that time, the Intent parameter is null.
    START_NOT_STICKY “Non-sticky.” If the service is abnormally killed after onStartCommand is executed, the system does not restart the service automatically.
    START_REDELIVER_INTENT The retransmission Intent. If the service is killed by an exception after executing onStartCommand, the system automatically restarts the service and passes in the Intent value.
    START_STICKY_COMPATIBILITY A compatible version of START_STICKY does not guarantee that the service can be restarted after being killed.
  • PopupWindow and Dialog cannot be displayed while the Activity is not fully displayed

  • Do not use SharedPreferences to share data between multiple processes, although it is possible (MODE_MULTI_PROCESS), it is extremely unstable

  • Sometimes the Application Context cannot be used, otherwise an error will be reported (e.g. starting an Activity, displaying a Dialog, etc.)

* Note: You will notice that some numbers have been added to some NO’s, which are actually YES in terms of capability, but why are they said NO? Number 1: Starting an Activity in these classes is ok, but creating a new task is not recommended. 2. Number 2: The layout inflate is legal in these classes, but will use the system default theme style, which may not be used if you customize some styles; 3. Digit 3: allowed when Receiver is null. In 4.2 or later, it is used to obtain the current value of sticky broadcast. Can be ignored; 4. ContentProvider and BroadcastReceiver are listed in the above table because they both have a context used in their internal methods.

  • Be careful with Android’s transparent theme, which can cause problems. For example, if a new Activity has a transparent theme, the current Activity’s onStop method will not be called. When you press the Home button on an Activity screen with a transparent theme, the screen may flush unclean. There is an obvious delay when entering the interface with a transparent theme
  • Do not initialize the ViewStub in a non-UI thread, otherwise null will be returned

  • Try not to cache data through Application, it is not stable

  • Huawei mobile phone can not open THE USB debugging problem,

  • Plug in the data line and input the dial interface## 2846579 ##Enter engineering mode
  • Projectmenu →3 background Settings →4USB port configuration →Balong debugging mode, click OK
  • Do not unplug, exit engineering mode, directly restart the phone, the computer display removable disk (if it still does not appear, repeat steps 1 and 2)
  • This is how you can use your phone’s removable disk on your computer with USB debugging turned off, and the USB option is back in the drop down menu.

  • Android :transcriptMode=”normal” when you set the listView

  • TextUtils is a very useful utility class that converts lists into strings, comma-separated, comma-separated strings, and splits them into lists using TextUtils’ join and split methods, respectively. If you want to de-duplicate a List, you can use the Collection frequency method.

  • Call the moveTaskToBack (Boolean nonRoot) method in the activity to move the activity back to the background, not finish().

  • The runOnUiThrea(Runnable Action) method in the activity goes straight back to the main thread

  • Listview has the footerDividersEnabled and headerDividersEnabled methods to set the top and bottom divide of the ListView, but make sure you set the headView and footView for this to work

  • The getStackTrace() method in the Throwable class, which returns the layer-by-layer address of the function, StackTraceElement[];

  • The StackTraceElement class, where four methods getClassName(), getFileName(), getLineNumber(), and getMethodName() are useful when debugging programs to print logs;

  • UncaughtExceptionHandler interface, no matter how good the code exception is unavoidable, the use of this interface can not catch the exception

  • The getIdentifier(name, defType, defPackage) method in the Resources class obtains the ID of a resource based on its name.

  • IsShown () returns TRUE only if the view and all of its ancestors are visible. Normally, we call if(view.getvisibility () == view.visible) only to judge the view itself and not the visibility of the ancestors.

  • The Arrays class provides a series of utility methods for manipulating Arrays: binarySearch(), asList(), equals(), sort(), toString(), copyOfRange(), etc. A set of utility methods in the Collections class on collection operations: sort(), reverse(), and so on;

  • Android. Text. The format. The Formatter class formatFileSize (Context, long) method, used to format the file Size (B – KB – > MB – GB);

  • Android. Media. ThumbnailUtils class, which is used to obtain the media (image, video) thumbnail;

  • TextView class append(CharSequence) method to add text. Some special text with a + concatenation will become a String;

  • Arraycopy (SRC, srcPos, dest, destPos, length);

  • Fragment onHiddenChanged(Boolean) methods in Fragment class. Using hide(), show() methods in FragmentTransaction will not invoke any other Fragment lifecycle methods.

  • OnWindowFocusChanged (Boolean), onNewIntent(Intent), etc.

  • TextView class setTransformationMethod(TransformationMethod), which can be used to “display password” function

  • PageTransformer interface, using custom ViewPager page switch animation, using setPageTransformer(Boolean, PageTransformer) method to set;

  • Apache provides a series of JARS: Commons-lang. jar, commons-collections.jar, commons-beanutils.jar, etc. Many of these methods are probably implemented with tens or hundreds of lines of code, but may be much less efficient. For example: ArrayUtils StringUtils… ;

  • ActivityLifecycleCallbacks interface for monitoring change of state of each Activity in the Application class! [read address]{mp.weixin.qq.com/s?__biz=MzA… }

  • Actionbar.hide ()/.show() As the name suggests, hides and shows the ActionBar, elegantly switching between full screen and with ActionBar.

  • Systemclock. sleep() this method is handy for guaranteeing sleep for a certain amount of time, which I usually use for debugging and simulating network latency.

  • UrlQuerySanitizer – This tool makes it easy to check urls.

  • ActivityOptions — Easily define the animation between two activities. Using ActivityOptionsCompat is a good way to solve compatibility problems with older versions.

  • getParent().requestDisallowInterceptTouchEvent(true); Deprive the parent view of handling touch events, whoever uses it knows.

  • HandlerThread, instead of repeating a new Thread to open a child Thread.

  • IntentService, a Service that can die after it’s done without requiring us to manage child threads

  • Executors. newSingleThreadExecutor(); So this is Java, and I didn’t know about it, but I did a lot of research on single-threaded sequential task queues

  • Android: animateLayoutChanges = “true”, adding the View LinearLayout animation to support through setLayoutTransition () custom animation.

  • AsyncQueryHandler, if do system tool class development, such as contact text assistance tools, etc., will inevitably deal with ContentProvider, if the data volume is not very large, just do it, if the data volume is large, it is necessary to understand this class, need to pay attention to is, This thing doesn’t taste good…

  • ViewFlipper, realizes the switch of multiple views (loop), can customize the animation effect, and can specify animation for a single switch.

  • The Pair class in the Android Util package can be conveniently used to store a “group” of data. Note that it is not a key value

  • Android: descendantFocusability, CheckBox in the item of ListView elements such as rob focus item click event can’t response, In addition to the corresponding set focusable element, is more simple in item root layout with android: descendantFocusability blocksDescendants = “”

  • IncludeFontPadding =”false”, TextView by default has a bit of padding on the top and the bottom, sometimes we don’t want to leave the top and the bottom blank, just add it.

  • Messenger, when you’re interviewing for a job, you’re often asked about interprocess communication, and people usually start to recite AIDL blah blah blah. One day I saw this in Hongshen’s blog. Well, as he said, I can pretend again.

  • Edittxt. setImeOptions, edit the return key display when using EditText to pop up the soft keyboard.

  • The LocalDate and LocalTime interfaces are new to Java8. Date is a universal interface, but it is really not useful. With these two interfaces, we can finally handle dates and times with pleasure.

  • WeakHashMap. Using HashMap directly sometimes brings the risk of memory overflow. WaekHashMap is used to instantiate the Map. When the user no longer has an object reference, WeakHashMap will automatically remove the object with the corresponding Key value.

  • When using SnackBar, do not use view.getrootView () as the view of SnackBar, Huawei Honor 7 will have problems.

  • Instead of using Lines=1, use singleLine=” True “, because some meizu phones will be confused when Lines=1 is set and the TextView values are all numbers.

  • The TouchDelegate can be used to change the touch region of a View. Example: In RecyclerView ItemView contains CheckBox component, and then want to achieve click ItemView, can also trigger CheckBox, you can use this class

  • ArgbEvaluator can be used to calculate the interpolation between different color values, cooperate with ValueAnimator. OfObject or ViewPager. PageTransformer use, can realize smooth transition between the different colors.

  • The Palette is used to extract the color of an image.

  • ViewDragHelper, if you’ve ever done a custom ViewGroup, you probably know this thing. It’s used to handle touch events. Mom doesn’t have to worry about my custom controls anymore.

  • PageTransformer is used to define the animation effects when switching between ViewPager pages (fade in and out, zoom in and out…). There’s an official example. Just read it.

  • Formatter.formatFileSize is automatically converted to a utility class in KB, MB, or GB based on the file size. Think of all the calculations you used to do…

  • Activity. Recreate an Activity. What’s the use? You can refresh the current Activity immediately after the application changes theme, without an obvious animation to restart the Activity.

  • View.getcontext, as the name suggests, doesn’t need to be explained… In order to use LayoutInflater, we used to pass an external context in the constructor. .Am I the only one who doesn’t know

  • View.post allows you to modify an interface in a non-UI thread, similar to what Handler does. And since the Runnable of post is guaranteed to be called only after the View has been drawn, it can also be used to get the width and height of the View.

  • Activity.runonuithread is similar to view.post, making it easy to modify the interface in a non-UI thread.

  • Fragments. SetUserVisibleHintFragment can override this method, and then according to the parameters of the Boolean value (true saying current fragments visible to the user), to perform some logic.

  • Android: animateLayoutChanges this is a very cool properties. In the parent layout with android: animateLayoutChanges = “true”, if triggered layout method (for example, it’s a View set to GONE), the system will automatically help you add the layout change of animation effects!!!!!

  • Android :clipToPadding Sets whether the parent view allows its children to draw inside its padding. Isn’t that a little convoluted? Here’s a practical scenario: Android :clipToPadding=”false” Android :paddingTop=”10dp” Android :paddingTop=”10dp” Android :clipToPadding=”false” Android :paddingTop=”10dp” Is it convenient?

  • The rv Layoutmanager can directly stated in the XML, specific code to view RecyclerView. CreateLayoutManager method.

  • RecyclerView added the function of automatic measurement in the 23.2.+ version. Because of the new automatic measurement, the root layout of its item cannot be match_parent in the direction to be measured, it needs to be changed to WRAP_content

  • getParent().requestDisallowInterceptTouchEvent(true); Deprive the parent view of handling touch events, whoever uses it knows.

  • Canvas clipRect, clipPath, and clipRegion clipping region API.

  • GradientDrawable (GradientDrawable) GradientDrawable (GradientDrawable)

  • There are many methods that do not support hardware acceleration after API16. Usually, we turn off hardware acceleration in the manifest file. SetLayerType (view.layer_type_software, null); Can.

  • A class in the PointF, Graphics package that defines a downX and a downY to store a coordinate when handling Touch events. If there are too many coordinates to record, the code will not look good. Use PointF(float x, float y); It’s much clearer to describe a coordinate point.

  • StateListDrawable, the usual way to define a Selector is in an XML file, but sometimes we can get our image resources dynamically from a server, like a lot of apps called skins, and then we can only do that with StateListDrawable, Various add states will do.

  • Android: duplicateParentState = “true”, let the child View with the Parent state, such as pressed, etc. A common usage scenario is when a button is small, and we want to expand the click area of the button we’ll usually wrap it around another layer, write the click event to the Parent, and then if we want the Selector of the wrapped button to continue to work, This is where duplicateParentState comes in.

  • ViewConfiguration.getScaledTouchSlop(); Trigger the minimum distance of the movement event, custom View processing touch events, sometimes need to determine whether the user really exists in the movie, the system provides such a method.

  • ViewStub: Sometimes an area needs to display different layouts according to the situation. Usually, we use setVisibility to display and hide different layouts, but by default, all the layouts are loaded. Using the ViewStub can improve performance.

  • OnTrimMemory, overwritten in the Activity, will call back when memory is tight (multiple levels supported), so that we can actively free resources and avoid OOM.

  • TextView setCompoundDrawablePadding, code sets the TextView drawable padding.

  • ImageSwitcher, a class that can be used to switch images, similar to slides.

  • Use drawable when customizing controls to draw circles or other styles, because drawable is much better than canvas.drawxxx ().

  • If you want to customize the View to support SwipeRefreshLayout, you just need to declare and implement ScrollingView interface, RecyclerView and NestedScrollView already implement this interface.

  • AtomicFile – Atomize files by using backup files. I’ve written about this before, but it’s better to have an official version.

  • DatabaseUtils – a user tool that contains various database operations.

  • Activity. IsChangingConfigurations () – if the configuration will often change in the Activity, use this method can need not manually do the work of saving state.

  • SearchRecentSuggestionsProvider — a sign can create the recent effect of the provider, is a simple and rapid method.

  • Android :clipChildren (ViewGroup) – If this property is set to unavailable, the child View of the ViewGroup will be drawn out of its scope and needed for animation.

  • Android :fillViewport (ScrollView) — Article links are detailed in this article, which can solve the problem of filling the screen when the content in the ScrollView is insufficient.

  • Android :tileMode (BitmapDrawable) — You can specify the image to be filled repeatedly.

  • Android: enterFadeDuration/android: exitFadeDuration (Drawables) – this attribute in the Drawable with multiple state, you can define it presents in front of the fading effect.

  • Log.wtf() means What a Terrible Failure, not What The Fuck!

  • Use RenderScript to blur the image effect. If your app has a minSDK of 16 or lower, you need to use support mode, as many methods were added after API 17. The renderscriptTargetApi is up to 23, but you should set it to the minimum API that keeps the functionality used in your scripts intact. If you want target API 21+ in support mode you must use Gradle-Plugin 2.1.0 and buildToolsVersion “23.0.3” or above. Need to add in the gradle renderscriptTargetApi 18, renderscriptSupportModeEnabled true these two words

public static Bitmap blurBitmap(Context context, Bitmap src, int radius) {
        Bitmap dest = src.copy(src.getConfig(), true);
        RenderScript rs = RenderScript.create(context);
        Allocation allocation = Allocation.createFromBitmap(rs, src);
        Type t = allocation.getType();
        Allocation blurredAllocation = Allocation.createTyped(rs, t);
        ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
        blurScript.setRadius(radius);
        blurScript.setInput(allocation);
        blurScript.forEach(blurredAllocation);
        blurredAllocation.copyTo(dest);
        allocation.destroy();
        blurredAllocation.destroy();
        blurScript.destroy();
        t.destroy();
        rs.destroy();
        return dest;
    }Copy the code

public void captureView(){ int height = getStatusHeight(mContext); Bitmap bmp1 = Bitmap.createBitmap(tempView.getWidth(), tempView.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bmp1); tempView.draw(canvas); int currentapiVersion = android.os.Build.VERSION.SDK_INT; Bitmap bmp2 = null; */ if (currentapiVersion >= build.version_codes.lollipop) {bmp2 = bitmap.createbitmap (bmp1, 0, bmp2); height, bmp1.getWidth(), bmp1.getHeight() - height); } else { bmp2 = Bitmap.createBitmap(bmp1); } bmp1.recycle(); } private int getStatusHeight(Context ct) { int result = 0; int resourceId = ct.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = ct.getResources().getDimensionPixelSize(resourceId); } return result; }

Copy the code

  • Android Studio 2.1 already supports JDK8. If you need to add buildToolsVersion to Gradle, you need to update buildToolsVersion to 24 or higher
android { defaultConfig { ... jackOptions { enabled true } } ... CompileOptions {targetCompatibility 1.8 sourceCompatibility 1.8}}Copy the code
  • After 6.0 the getResources().getColor() method was deprecated and can be replaced with ContextCompat. GetColor (context, r.color.color_name). Feel free to use it, as well as getDrawable() and other methods

  • The official recommendation for image resource files is to put only the Launcher under the Mipmap folder, while the recommendation for app resource files is to put them under the Drawable.

  • The apply of SharedPreference.Editor is asynchronous and does not return a success status, while the commit is synchronous. Therefore, when multiple concurrent commits are committed, they will wait for the ongoing commit to be saved to disk before operating on the next data, which reduces efficiency.

  • If you set an activity in the manifest into android: windowSoftInputMode = “adjustResize”, then the ScrollView (or other scalable ViewGroups) will be narrowed, To make room for a soft keyboard. However, if you set Android :windowFullscreen=”true” in the activity theme, the ScrollView will not shrink. This is because this property forces the ScrollView to be displayed in full screen. However in the theme set android: fitsSystemWindows = “false” can also lead to adjustResize doesn’t work

  • After Android 4.0, statically registered broadcasts in manifest.xml must be started once after the application is installed to receive broadcasts. For example, if your application listens for broadcasts after startup, it must be run before it can hear broadcasts

  • The onDestory method of an Activity is called at an uncertain time (it is sometimes called long after you have left the interface), and you should avoid relying on the onDestory method to release activity-related resources, which can cause random bugs

  • 2. In the X era, Bitmap objects are stored in heap memory, but a byte array is used to store their pixel information. A counter is used to record the number of references to the pixel information. Some people think this byte array is in the native heap, but in fact it is in the heap. Only after the consumer calls recycle() does the Bitmap release pixel information and is destroyed by the garbage collection mechanism when the reference is lost. In addition, the HEAP size of DVM has a strict threshold, so it is very easy to get OOM when using a lot of image resources. The usual solution is to use a hash table to store a soft reference to a Bitmap object as an in-memory cache and discard its Recycle () when appropriate. Bitmap objects 3.0 or later can be completely destroyed through garbage collection, which theoretically eliminates the need to call Recycle ().

  • .gitignore can only ignore files that were not originally tracked, and will be modified if some files have been versioned. Gitignore is invalid. Then the solution is to delete the local cache (change it to untrack state) and then commit:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'
Copy the code
  • Please use long or String to receive the timestamp. As many models in the project are generated by GsonFormat, the timestamp in the JSON given by the server is 10 bits. The GsonFormat is automatically resolved to int, and an error occurs when the tester selects the year 2100 and the timestamp starts with 10 digits starting with 4