Network_type_ltecurrent Network is lteconstant value:13 (0x0000000d) (4G) public static final int Network_type_ Ehrpdcurrent Network is ehrpdconstant value:14 (0x0000000e) 3G (3G to 4G upgrade product)--------------------------Added in API level---------------------------public static final int Network_type_hspapcurrent Network is hspa+constant value:15 (0x0000000f) (3G)So we can networkinfo.getsubtype () to get the value and the above to correspond, we know that the current is a few G network.
In the development process, often encounter such a scene, click the button, the background color changes: In drawable, define Xxx.xml (selector)selectorxmlns:android= "Http://schemas.android.com/apk/res/android"> Itemandroid:drawable= "#ee0000"android:state_focused= "true"/> Itemandroid:drawable= "#ee0000"android:state_selected= "true"/> Itemandroid:drawable= "#ee0000"android:state_pressed= "true"/> Itemandroid:drawable= "#00ee00"/>selecto
as:The last is to modify the hosts on the server, refer to the above DNS configuration hosts operation is the sameIt's almost all set up.The last thing to note is to clear the cache on the phone, be sure to close the browser and app, clean up the memory and then open, or the phone's DNS and network settings may not be switched over.The above configuration I have been tested on Android devices, IOS is not applied to test, but it should be said to be t
Android phones because of the open source of its system features, users can make a lot of personalized customization, to create their own unique one of the mobile phone. Font replacement is a lot of people often use a personalized modification, on the Android font replacement, there are many ways, here for you to sum up.
1, find your favorite fonts, replace with the RE manager. How to: Download your favori
Ssb.setspan (new Relativesizespan (1.2f), 1, Ssb.length (), spannable.span_exclusive_exclusive); return SSB;}Effects such as:watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvtlvqvgjvevpiqg==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center "/>Project Source: Https://github.com/nuptboyzhb/ViewPageAnimatorDemoNot for commercial purposes without consentOf course, you can also consider using the open source code: Https://github.com/astuetz/PagerSlidingTabStrip Copyright notice:
When adding text in textview, you sometimes need to change the color of some text fonts. Today I learned three ways to share them:
1. Set the font color directly in the configuration XML file under the layout file, and change the color by adding Android: textcolor = "# ffffff"
However, this effect only allows the font to display one color.
2. in the activit
closed.
Test results:java : Java new 5000s waste 3ms c++ : c++ new 5000s Waste 18ms java : java new 10000s Waste 5ms c++ : c++ new 10000s waste 24ms Span class= "http" >java : java new 50000s waste 44ms c++ : c++ new 50000s waste 121ms java : java new 100000s waste 65ms c++ : c++ new 100000s waste 259ms This time, the results show that the cache method ID and Jclass can be shortened by half the time. But still less fast than Java. This is also very well understood. C + + cr
properties of the dialog are specified. It's a pity. At the moment I see these related properties are not public, can not set their own, so only through the Java code to achieve.This blue line is called Titledivider, and we are able to get its IP through the getresources () API, and then set the color. The code is as follows: public static final void Dialogtitlelinecolor (Dialog Dialog, int color) { Context context = Dialog.getcontext (); int divierid = Context.getresources ().
Android. support. v4.view. How does ViewPager dynamically change the display content?
Look at a simple piece of code and display two textviews in a pager.
List
items = new ArrayList
();adapter = new MyPagerAdapter();
TextView TV = new TextView (getActivity (); TV. setText (first page); items. add (TV); TV = new TextView (getActivity (); TV. setText (second page); items. add (TV); pager. s
The way to change the font size is to use a activitymanagernative classFirst, before the code declaresPrivate Configuration Mconfig = new configuration ();and set the value in your code to change the font sizeMconfig.fontscale = 0.75f;//feel 1.0fOther than that. You also need to add android:configchanges= "Fontscale" to the Androidmanifest.xml.In the Spreadtrum platform, the preset font sizeExtra Large: 1.3
Text Change monitoring:Username is an object of EditTextUsername.addtextchangedlistener (New Textwatcher () {@Overridepublic void ontextchanged (charsequence s, int start, int before, int count) {The number of references means: S text content, start changes from the first few characters, before (oneself can test. I did not test), count changed the number of charactersTODO auto-generated Method StubLOG.I ("EditText", s.tostring ());}@Overridepublic voi
First of all, in the resource file put the icon picture you want to change to the Drawable-xx folder , and then open the Androidmanifest.xml this configuration list file to findTo the application tag of this sentence android:icon= "@drawable/ic_launcher" where ic_launcher this is the name of the quoted picture,For example, in the drawable-xx to find a aa.jpg picture, you can refer to the manifest file android:icon= "@drawable/aa" Here is to modify the
TextView changevideoqualitytxt = (TextView) Rootview.findviewbyid (r.id.enter_wireless_display_txt);String Text1 = getString (R.string.enter_application_wireless_display);Spannablestringbuilder style1 = new Spannablestringbuilder (Text1);Style1.setspan (New Foregroundcolorspan (Getresources () GetColor (R.color.high_light_color)), Spannable.span_ exclusive_inclusive);Changevideoqualitytxt.settext (Style1);If you want to insert a picture in a line of text:TextView changevideoqualitytxt = (TextVie
maximum Drawingcache value, a problem occurs when the bitmap is generated, and the bitmap obtained is null. so you can fix the problem by simply modifying the desired cache value. So we introduced the second method:public static Bitmap Convertviewtobitmap (view view) {View.measure (Measurespec.makemeasurespec (0, measurespec.unspecified), Measurespec.makemeasurespec (0, measurespec.unspecified));View.layout (0, 0, view.getmeasuredwidth (), View.getmeasuredheight ());View.builddrawingcach
Like Change pageChange activity First we should create a activity,We should extends class activity and override OnCreate (), then configure information in Androidmainfest.xml.There importment attrbutes call name and label, name Attrbute tell Android system how to find activity and the label E AUQL the title of the activity. PackageCom.example.chatdemo;Importandroid.app.Activity;ImportAndroid.os.Bundle;Impor
type; int id = cursor.getint (cursor.getcolumnindex ("id")) ; String named = cursor.getstring (Cursor.getcolumnindex ("name")); String number = cursor.getstring (Cursor.getcolumnindex ("number"));//Instantiate query result data Object person = new person (ID, named, number);} Close the database connection, release the Resource Db.close ();//Return the data result object return person; /** * Update a data according to name * * @param name * with new conditions * @param newnumber * NEW data * @re
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.