To obtain corresponding usually we are using findviewbyid () method to obtain the view control we want to use, but in addition to this kind of method, we can also view setTag Onbect view to add an extra data, and then getTag) (the view. SetTag () and getTag () methods commonly used in the treatment of multiple identical View, such as we have to add a few Button click on the event, we can use view.getId () to distinguish Button, also...
15:30 2015-04-29
read(308)
Development, we often have to get the phone screen high wide data. Usually we will write a method such as getScreen (); and then call the getScreen () method in the Oncreate () (). We may get to the result that the width is 0. This is why? The reason lies in:
In the life cycle of activity, the oncreate, OnStart and onresume are not real screen visible (visible), real time visible point is in when onWindo...
14:16 2015-04-29
read(412)
Development of the Android APP application will be uploaded to the application market, if you want to achieve directly into the Market Android to find their desired application, we should be how to operate it? There must be some way, but the premise is to know the name of your application or the name of the developer or keyword. Of course, if you know the name of the application, the application is the most accurate! Below are introduced under:
1, by the name of the package to find applications:
Uri URI = Uri.parse ("market://...
13:49 2015-04-29
read(372)
In the application of the time, the different components of the communication between the two: a page in the data has changed, it may be necessary to inform the corresponding changes in a page. Before I used the method of:
1, the radio, through the radio to inform the corresponding interface,
2, write callback interface, through the implementation of the callback interface to notify the change in the corresponding data, etc..
Later used the communication between the components of open source EventBus framework, can be said to be feeling super convenient, save time, code! In the use of EventBus, the process is generally as follows:
1, Download jar EventBus and guide...
16:10 2015-04-27
read(112)
Frame animation is a kind of Android animation, similar to the movie we see the same, the animation is composed of N Zhang pictures, in a time when the ground to show pictures to achieve animation. There are two ways to achieve Frame animation, a XML in the animation layout, the other is pure code to achieve.
Look at the XML layout method of Frame animation:
In the code to achieve the three sentence code:
...
16:59 2015-04-24
read(254)
Usually the Android application development must have pictures, looking for art design pictures, into the project can be, but in addition to the use of the existing picture, we can also in 2D drawing is in the view painting patterns or text. Which usually have to use the class Canvas (canvas), Paint (brush) and Color (used to set the brush color) class, of course, may also use other types, are based on the needs of their projects to be set.
: Canvas canvas, used to directly draw on View such as rectangular, circular, text and bitmap graphics. ...
11:46 2015-04-24
read(250)
Please respect the original work, reproduced, please indicate the source: http://prog3.com/sbdm/blog/cyp331203/article/details/45071069, non permissible, do not for commercial use or profit. All rights reserved.
Android a touch event, the Internet also has many articles in terms of the, here today want to use examples and source code combination way, may see more clearly.
Before speaking examples and source code, or the first conclusion about...
11:13 2015-04-24
read(107)
In the development process, although the Android system provides a lot of control for us to use, but still can not meet the needs of our human beings, we really feel greedy, huh, huh! This time, we may use the custom control, as well as the custom attribute, how should operate?
Generally according to the following steps:
1, inherited View or other controls, onMeasure, override the constructor onDraw, onTouch and other functions.
2 custom attributes, you need to build in values...
10:37 2015-04-23
read(384)
In the layout of the interface, we often use is LinearLayout, but sometimes it is not easy, for example, we in the page to put a button at the bottom of the screen at this time we set Android: layout Android:layout_gravity= "bottom" is no effect. Why? about
LinearLayout:
When android:orientation= "vertical", only in the horizontal direction is set to take effect, the vertical direction is not set...
10:42 2015-04-21
read(405)
Http://schemas.android.com/tools "xmlns:tools="
Android:layout_width= "match_parent"
Android:layout_height= "match_parent"
Android:paddingBottom= "@dimen/activity_vertical_margin"
Andr...
16:57 2015-04-20
read(314)
Tween Android animation to achieve the principle: through the View content of the graphics transformation (translation, scaling, rotation, transparency) to achieve animation effects. The definition of animation effects can be used to do the XML can also be used to do encoding, today simply talk about the use of code to achieve Tween animation in the four animation. Four kinds of animation on the four animation classes:
Gradient transparency animation
AlphaAnimation
Zoom animation effects
Scale...
10:14 2015-04-20
read(238)
Recently in the project in a small number of features is with the listview show the application of the phone has been installed, on the Internet for a demo (thanks to demo the sharer) and according to their own needs changed a bit, to change after code posted, leave a note:
- the first is the application of the information Bean------------------------
Class AppInfo implements Serializable public {
Priv...
15:05 2015-04-17
read(337)
We know that to start an application, you need to know the name of the application to start the Activity, but start the ACTION Activity parameters, so you can start by startActivity (Intent), such as:
Application of activated / * * the package name is com.xx.xx, the application of com.xx.xx.TestLaunchActivity**/ entrance
Intent intent = new (Intent)...
11:13 2015-04-16
read(354)
Class TestActivity extends Activity public {
The layout of the code written in View*/ / * *
LinearLayout mParentLinearLayout private;
The title / * * TextView*/
TextView mTitleTv private;
To display data in ListView*/ / * *
Private ListView mListView...
10:24 2015-04-16
read(236)
Class PhoneSIMCInfo public {
Mobile phone management tool * / / * *
TelephonyManager telephonyManager private;
International mobile subscriber identification code * / / * *
String mImsi private;
PhoneSIMCInfo public (context Context) {
TelephonyManager = (TelephonyMan =...
14:49 2015-04-15
read(315)