Intent中有显示Intent和隐式Intent,显示Intent一般用于程序内部并且明确Activity的名字,启动时一般是intent
= new
Intent(上下文,Activity名字.class);隐式Intent一般用于不同应用程序的交互。开发中经常用到了显示Intent,而In.....
分类:
其他好文 时间:
2014-05-10 18:47:50
阅读次数:
296
将Activity显示成Dialog的形式:Tip: If you want a custom
dialog, you can instead display an Activity as a dialog instead of using the
Dialog APIs. Simply creat...
分类:
其他好文 时间:
2014-05-10 07:52:33
阅读次数:
369
public class MainActivity extends
ActionBarActivity { private static ActivityManager am; private static List
appList; private static List ta...
分类:
其他好文 时间:
2014-05-10 07:49:35
阅读次数:
256
如图:
点击单选按钮"开灯",多选按钮就会显示"关灯"且方块里有对勾;反之,点多选按钮,单选按钮也自动改变。
首先,先创建一个安卓项目(我的版本是4.4.2的),名字为"bulb",把两张图片:开灯与关灯状态的图片放入"drawable-"随意一个文件夹下
然后在res文件夹下找到layout文件夹,找到activity_main.xml或fragment_main.xml,在里面输...
分类:
移动开发 时间:
2014-05-10 04:26:27
阅读次数:
466
public void replaceRightView(View v) {
int f = LinearLayout.LayoutParams.MATCH_PARENT;
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(f, f);
LinearLayout fragment_place = (Line...
分类:
其他好文 时间:
2014-05-09 22:50:20
阅读次数:
332
如图,点击按钮就会切换屏幕的颜色
首先,先创建一个安卓项目(我的版本是4.4.2的),名字为"world",当然,也可以别的名称
然后在res文件夹下找到layout文件夹,找到activity_main.xml或fragment_main.xml,在里面输入或拖拽按钮
<RelativeLayout xmlns:android="http://schemas.android.com/apk...
分类:
移动开发 时间:
2014-05-09 22:30:47
阅读次数:
441
当我们在Launcher界面单击一个应用程序图标时就会启动一个程序,那这一个过程究竟发生了些哪样呢?让我们跟踪Launcher源码来分析一下吧。先上流程图:step1、追踪Launcher从源码中我们可以发现Launcher其实也是一个程序,它继承于Activity。找到该文件中的onCreate()方法,代码..
分类:
移动开发 时间:
2014-05-09 21:22:25
阅读次数:
497
下面是第一篇的连接Android的ViewGroup中事件的传递机制(一)关于onInterceptTouchEvent和onTouchEvent的详细解释。
1 public class MainActivity extends Activity { 2 Group1 group1; 3 ...
分类:
移动开发 时间:
2014-05-09 20:21:43
阅读次数:
379
在接入第三方渠道SDK的时候,经常会看到其配置文件AndroidManifest.xml有类似如下的定义:[html]view
plaincopy笔者这里在Application级别和Activity级别都定义了一个meta-data,我们如何来取得这两个组件的值呢?如下:[java]view
pl...
分类:
移动开发 时间:
2014-05-09 20:07:37
阅读次数:
449
官网地址
ttp://developer.android.com/training/gestures/detector.html:
一、可以直接覆盖Activity的onTouch方法
public class MainActivity extends Activity {
...
// This example shows an Activity, but you w...
分类:
移动开发 时间:
2014-05-09 14:39:07
阅读次数:
469