
android
fishermanmax
这个作者很懒,什么都没留下…
展开
-
Android Studio配置SDK
sdk Android SDK Manager就是一个Android软件开发工具包管理器,选中下载即可。 此图感谢“”迷途的国王“”转载 2016-08-02 00:27:36 · 709 阅读 · 0 评论 -
android使用fragment托管
依赖包的添加:file-Project Structure-app-dependencies添加依赖包 EditText的hint是编辑框的提示输入 首先为fragment创建一个layout视图,重写onCreateView实现视图加载并实现监听: @Override public View onCreateView(LayoutInflater inflater原创 2016-08-07 22:35:14 · 434 阅读 · 4 评论 -
android的版本兼容
ViewAnimationUtils为例,如果没有进行版本判断会报错。因为这个只能在api21以上才能使用。 if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ int cx = mShowAnswer.getWidth()/2; int cy = mShowA原创 2016-08-06 23:39:48 · 345 阅读 · 0 评论 -
静态缓存设置缓存失效时间
将缓存时间存入静态缓存文件,拼装时间 $cacheTime = sprintf("%011d",$cacheTime); return file_put_contents($filename,$cacheTime.json_encode($value)); 判断失效时间: $contents = file_get_contents($filename); $cacheTime = (int原创 2016-08-06 19:52:46 · 1294 阅读 · 0 评论 -
Activity的生命周期
生命周期:运行状态->(onPause)->暂停->onStop()->停止->完成或销毁->onDestroy()->不存在->启动->onCreate()->停止->onStart()->暂停->onResume()->运行 点击返回会到销毁,旋转屏幕会重新运行 横屏布局加载:右键res新建directory 选择layout-orientation创建横屏布局文件存放,复制原来的原创 2016-08-03 10:47:46 · 259 阅读 · 0 评论 -
android的调试
记录栈跟踪日志: 在被调用的方法前加入: Log.d(TAG,"Updating question text for question #"+mCurrentIndex,new Exception()); 进行LogCat调试,查找问题。 Debug工具调试: 设置断点: 需要调试的代码前面设置断点,进行Debug调试模式。 异常断点: run-view原创 2016-08-05 14:13:22 · 254 阅读 · 0 评论 -
第一个Android应用
MVC架构大概是layout:view activity:controller 自定义的类:model C:package com.example.sougeng.sougeng; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.V原创 2016-08-02 09:24:58 · 520 阅读 · 0 评论 -
Android学习的起步
makeText(Context context,int resId,int duration) 实例:Toast.makeText(MainActivity.this,R.string.incorrect_toast,Toast.LENGTH_SHORT).show(); 短时间显示 命令行编译: Linux:gradlew tasks windows:gradlew.bat t原创 2016-08-02 07:29:00 · 210 阅读 · 0 评论 -
Android Studio 设置内存大小及原理
http://www.cnblogs.com/justinzhang/p/4274985.html http://tsroad.lofter.com/post/376316_69363ae Android studio 1.0.2默认最大内存是750M,这样跑起来非常的卡,难以忍受,机器又不是固态硬盘,最后发现,这个默认值是可以修改的,在android studio转载 2016-08-02 06:26:05 · 715 阅读 · 0 评论 -
Anrdoid的Activity之间的通信
主要使用Intent进行通信 Intent i = new Intent(父.this,子.class); startActivity(i);就可以传递到子activity Intent数据传递: 父通过Intent i = 子.newIntent(父.this,数据); startActivity(i);传给子 子Intent i = new Intent(传过来的a原创 2016-08-06 00:41:28 · 390 阅读 · 0 评论