zoukankan      html  css  js  c++  java
  • android 知识点小结

    android 知识点小结:

    1> 在res/values/color.xml;drawable

         layout里使用color@drawable/white

         java里调用:R.drawable.white

    2> android里的转议字符:\

         :\\

         :\?

         :\'

    3> android 中添加activity,需在androidmanifest.xml中定议一个新的:

        <activity android:name="exo2_01_01"></activity>

    4> 不同activity间数据传递;

         传:

         Bundle bundle =new Bundle();

          bundle.putString("name","chenlong");

         intent.putExtras(bundle);

        stratActivity(intent);

          收:

           Bundle bundle=this.getIntent().getExtras();

                      bundle.getString("name");

    5> 返回数据到前一个activity,实现onactivityResult方法:

    6》引和外部字体assets/fonts/types.ttf:mText.setTextSize(Typeface.createFromAsset(getAssets(),"fonts/types.ttf"));

    7> local,configuration多语言之技:

        res/drawable-en/flag.png

        res/drawable-zh/flag.png

    8> Toast.makeText(ex_04.01.this,"this is a toast test",Toast.LENGTH_LONG).show();

    9> android中数学函数的使用:Math.random()随机函数;

    10》 读取手机SD里的图片:

            string filename="/data/data/a.png";

            File file=new(filename);

            if(file.exists())

             {

               Bitmap bm=BitmapFactory.decodeFile(filename);

               mimage.setImageBitmap(bm);

             }

     11> android正则表达式:android:autoLink="web|phone|E-mail"

             Linkify.addLinks

             (

                 mtextview01,Linkify.WEB_URLS|Linkify.E-MAIL_ADDRESSES|Linkify.PHONE_NUMBERS

             ) ;

    12> 打电话的权限设置:<uses-permission android:name="android.permission.CALL_PHONE">       

  • 相关阅读:
    李洪强经典面试题43
    李洪强经典面试题42
    李洪强经典面试题41-iOS选择题
    HTTP头部解析
    iOS
    内网安全工具之hscan扫描
    跟着百度学PHP[4]OOP面对对象编程-17-多态
    绕过注入学习笔记
    引用/别名
    跟着百度学PHP[4]OOP面对对象编程-16-switch逻辑就语句
  • 原文地址:https://www.cnblogs.com/csj007523/p/2097975.html
Copyright © 2011-2022 走看看