Summary of problems encountered during android development [4]. android Summary
92.
Looks like there is no way to avoid modifications made by the import plugin. all the settings it has is three checkboxes related to dependency management. I tried to uncheck all of them but still it does change my project structure.
I managed to add existing library projects manually:
1) Copied library's directory under the root directory of my project.
2) Referenced that library in settings. gradle by adding include ': libraryA '.
3) Added dependency to my project's build. gradle: compile project (': libraryA ').
Moreover, after that the IDE recognized that library as module and highlighted its folder in bold font whithin Project Structure.
93. How do I obtain the Root View from the current activity or Android get the View of the Activity?
(ViewGroup) findViewById (android. R. id. content). getChildAt (0)
Or
GetWindow (). getDecorView (). findViewById (android. R. id. content)
94. In radiogroup, how does radiobutton not display the icon button, and wight can be used proportionally
Android: button = "@ none" or @ null
Android: drawableTop = "@ drawable/xxx" or set it to null.
95. Search is also an art concentrated search
96. android layoutinfater does not display content check whether the parent attempt is empty
97
. Error: Execution failed for task': app: dexdebug '.
Com. android. ide. common. internal. LoggedErrorException: Failed to run command:
/Home/yyb/tools/android/sdk/build-tools/21.1.2/dx-dex-no-optimize-output/home/yyb/work/BoShiTong/trunk/HBFC/Android /HBFC-AS/app/build/intermediates/dex/debug-input-list =/home/yyb/work/BoShiTong/trunk/HBFC/Android/HBFC-AS/app/build/intermediates/ tmp/dex/debug/inputList.txt
Error Code:
2
Output:
Unexpected top-level exception:
Com. android. dex. DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
At com. android. dx. merge. DexMerger. readSortableTypes (DexMerger. java: 596)
At com. android. dx. merge. DexMerger. getSortedTypes (DexMerger. java: 554)
At com. android. dx. merge. DexMerger. mergeClassDefs (DexMerger. java: 535)
At com. android. dx. merge. DexMerger. mergeDexes (DexMerger. java: 171)
At com. android. dx. merge. DexMerger. merge (DexMerger. java: 189)
At com. android. dx. command. dexer. Main. mergeLibraryDexBuffers (Main. java: 454)
At com. android. dx. command. dexer. Main. runMonoDex (Main. java: 303)
At com. android. dx. command. dexer. Main. Execute (Main. java: 246)
At com. android. dx. command. dexer. Main. main (Main. java: 215)
At com. android. dx. command. Main. main (Main. java: 106)
98. Three android animation formats: tween animition, frame animition, and property animition
99. LoopingViewPager QuickReturn
101. recycleview vs listview head foot. recycleview: Do not dodge new things in the gridview.
102. Clear unused resource http://www.cnblogs.com/angeldevil/p/3725358.html In the Android Project
103. xmlns: tools and tools: context
Tools: context = "activity name" is not packaged into the APK. Only the Layout Editor of ADT sets the corresponding rendering context in your current Layout file, indicating that the rendering context of your current Layout is the activity corresponding to the activity name, if Theme is set for this activity in the manifest file, the Layout Editor of the ADT will render your current Layout based on the Theme. That is to say, if the MainActivity you set has a Theme. light (others can also be used). The background, control, and Theme you can see in the visual layout manager should be Theme. light. It is only used to show you what you see is what you get.
105. androidstudio can be used only after libs is imported for synchronization
106. fragment + butterknife
Othersetting-> Compiler → Annotation Processors. Check "Enable annotation processing ".
108.
02-04 15:55:46. 426 5343-5343/com. jetsun. hbfc E/InputEventReceiver: Exception dispatching input event.
02-04 15:55:46. 426 5343-5343/com. jetsun. hbfc E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
02-04 15:55:46. 506 5343-5343/com. jetsun. hbfc E/MessageQueue-JNI: java. lang. RuntimeException: native typeface cannot be made
At android. graphics. Typeface. (Typeface. java: 175)
At android. graphics. Typeface. createFromAsset (type face. java: 149)
At com. jetsun. hbfc. activity. fragment. news. NewsFragment $1. onPageSelected (NewsFragment. java: 74)
109.
Custom Fonts in Android http://sudharti.github.io/articles/custom-fonts-android/
Typeface tf = Typeface. createFromAsset (getActivity (). getAssets (), "fonts/font_name.ttf ");
Typeface tf2 = Typeface. createFromAsset (getActivity (). getAssets (), "fonts/font_name2.ttf ");
TextView TV = (TextView) findViewById (R. id. textview );
TV. setTypeface (tf); // Set Typeface
EditText et = (EditText) findViewById (R. id. edittext );
Et. setTypeface (tf2 );
110. PagerSlidingTabStrip he view throws an exception if there are no tabs available to display. It wocould be great if the view failed gracefully or gave a better error message. https://github.com/astuetz/PagerSlidingTabStrip/issues/69
114. http://jgilfelt.github.io/android-actionbarstylegenerator/
This website can configure action bar styles online, including holo, support v7, And sherlock.
115.
After an exception occurs on other interfaces, return to the FragmentActivity Fragment display exception (overlapping or not displayed) solution...
Problem description see: http://www.eoeandroid.com/thread-496879-1-1.html
Of course, the problem has not been solved, and it has been very depressing. Today, I spent some time changing N keywords to find it. Finally, I forgot where to see a method, and I wrote it as a dead horse doctor.
Solution: rewrite onSaveInstanceState in FragmentActivity and remove super. onSaveInstanceState.
Cause: the guess is that after an exception is thrown on the second-level interface, the application will read the FragmentActivity cache status from the onSaveInstanceState when returning to the upper-level interface. As a result, all Fragment is displayed (OVERLAPPING) or cannot be displayed. (Just speculation)
[Code] php code: @ Override protected void onSaveInstanceState (Bundle outState ){}
116. Fixed repeated menu items and Fragment overlapping https://typeblog.net/tech/2014/08/22/fix-duplicate-menu.html in Android App
Fragment replace overlaps at on April 9, May 29, 2014. Generally, fragment containers are all fragment containers. The method used is FragmentManager fm = getActivity (). getsuppfrfragmentmanager (); FragmentTransaction ft = fm. beginTransaction (); ft. replace (R. id. container, fragment); ft. addToBackStack (null); ft. commit (); replace this method can be directly substituted into the layout id within the fragment, but in the external, such as Activitiy, the fragment overlay problem will occur. There are many people who want to set a background color or image for each fragment, but I think the extra resources are charged. In fact, we only need to change it to this. But who knows the principles? Http://stackoverflow.com/questions/12958555/android-replace-fragment-still-displays-some-of-the-replaced-fragmenttransaction.replace (ViewGroup) (getView (). getParent (). getId (), fragment );
117.
// Get its fM through activity and specify the parent fragment through tag to obtain the interface data.
If (getActivity (). getSupportFragmentManager (). findFragmentByTag ("videos") instanceof QuickReturnInterface ){
MCoordinator = (QuickReturnInterface) getActivity (). getSupportFragmentManager (). findFragmentByTag ("news ");
} Else {
Throw new ClassCastException ("Parent container must implement the QuickReturnInterface ");
}
118. Memory Optimization-related ANDROID memory optimization (large summary) http://blog.csdn.net/a396901990/article/details/38707007
119. PagerSlidingTabStrip Changing the title of the adapter and policydatasetchanged does not work. #13
Call policydatasetchanged () on the PagerSlidingTabStrip instead.
Worked for me yesterday with data loaded from a CursorLoader.
120. The screen recording software RecordMyDesktop in Ubuntu
Install: sudo apt-get install gtk-recordmydesktop: After installation, the software will be installed in the audio and video software. You can select the window for recording. If you do not select one, all operations are performed on the screen by default. Click "Recording" to start recording. At this time, the software is hidden in the taskbar (red circle) on the top and you can stop recording at any time. The video is saved in the main directory in the format of Ogg. If you need to convert it to the avi format, install the software mencoder. The command is as follows: sudo apt-get install mencoder and then use the following command to convert it: mencoder-ovc lavc-oac copy-lavcoptsvcodec = mpeg4-o outfile. avi infile. how to record a gif screen in ubuntu with a gif animation. install gtk-recordmydesktop to record the screen, install mplayer to split the video into a single-frame image, and install imagemagick to compress a single-frame image into a gif: sudo apt-get install imagemagick mplayer gtk-recordmydesktop2. execute the command line and record and save the file as out. ogv: gtk-recordmydesktop3. execute the following command to forward the out. the ogv is decomposed into single-frame images: mplayer-ao null out. ogv-vo jpeg: outdir =. 4. run the following command to compress a single image into a gif image: convert *. jpg out.gif 5. run the following command to compress gif images: convert out.gif-fuzz 10%-layers Optimize optimized.gif Live Like You're Dying And Never Stop Tying
121. A ListView will create many convertviews, not all of which are reused. For example, convertview displayed on the same screen must be different.
122. Selection of performance optimization frameworks. Volley [google-supported or native as much as possible] buttferty greendao [no reflection technology is used. For example, greendao uses code generation. Instead of annotation]
Why does greenDao use code generation instead of annotation? For greenDao, code generation is very reasonable. On the Android platform, annotation-based solutions are flawed: they have to rely on metadata parsing and reflection. In particular, reflection significantly reduces the performance of The ORM tool. On the other hand, greenDao generates optimized code for Android. The generated code completely avoids reflection. This is also the main reason why greenDao is so fast. Another advantage is the size. The core lib of greenDao is very small (below kb, including unit testing ). This is because the internal logic of some ORM systems is in generator rather than in the core library. GreenDao includes DaoCore, DaoGenerator, and DaoTest. DaoCore requires you to be added to the android project. It is licensed under Apache License 2. DaoGenerator is a java program responsible for entity generation, DAO and other files. DaoTest is the number of unit test cases, ensuring greenDao itself and its stability. DaoGenerator and DaoTest are available under GPL V3. These license terms can be used by most developers.
123. Lazy Loading
Lazy is not translated as lazy. It is almost a delay or delay.
It means that loading is not initiated, but is postponed until the loading is required.
124. android-stuido cocould not save application settings: java.util.zip.zip exception: incorrect header check
https://code.google.com/p/android/issues/detail?id=56190It looks like there's a corrupted cache.To work around this, invoke File > Invalidate Caches. If you can't start Android Studio at all, try going to the cache directory (its location depends on your platform) and delete it, then start Studio.
125. Android. gitignore https://github.com/github/gitignore/blob/master/Android.gitignore
. Gradle
/Local. properties
/. Idea/workspace. xml
/. Idea/libraries
. DS_Store
/Build
# Built application files
*. Apk
*. Ap _
# Files for the Dalvik VM*.dex# Java class files*.class# Generated filesbin/gen/# Gradle files.gradle/build//*/build/# Local configuration file (sdk path, etc)local.properties# Proguard folder generated by Eclipseproguard/# Log Files*.log
126. NDK With Android Studio http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/