Frequently asked questions in Andriod development _android

Source: Internet
Author: User

This article summed up the andriod development of common problems, for everyone to learn, the specific content as follows

problems with referencing layouts in layouts in 1.Andriod (You can use the following methods to save resources by referencing the layout in a layout)

<LinearLayout>
<include layout= "@layout/buttom" >
</LinearLayout>

2. How to determine if your mobile phone version is not more than 4.0
if (android.os.build.version.sdk_int>10)

3. Screen switching issues and activity restart issues
Add in required activity

android:screenorientation= "Portrait"//Screen can only be displayed on the vertical screen
 android:configchanges= "keyboardhidden|orientation"// Ensure activity does not restart when screen switch

4. Remove the APK head method
this.requestwindowfeature (window.feature_no_title);
add directly to Super.oncreate (Savedinstancestate);

How to call the Setup interface of mobile phone system in 5.Andriod

Intent mintent = new Intent ();
ComponentName comp = new ComponentName ("Com.android.settings", 
"com.android.settings.WirelessSettings");
Mintent.setcomponent (comp);
Mintent.setaction ("Android.intent.action.VIEW");
StartActivity (mintent);

6.Eclispe method of introducing third party package
associate with current project only: Right-click->properties->andriod on Current project, add a project to add, then apply

7.

convert int to String type
string.valueof (int)
to convert a string to an int
iterger.parseint (str)

These are the common problems in andriod development and hope to help you learn about Android software programming.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.